エントリーの編集
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
記事へのコメント1件
- 注目コメント
- 新着コメント
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
Object.create() - JavaScript | MDN
// Shape - スーパークラス function Shape() { this.x = 0; this.y = 0; } // スーパークラスのメソッ... // Shape - スーパークラス function Shape() { this.x = 0; this.y = 0; } // スーパークラスのメソッド Shape.prototype.move = function (x, y) { this.x += x; this.y += y; console.info("Shape moved."); }; // Rectangle - サブクラス function Rectangle() { Shape.call(this); // call super constructor. } // サブクラスはスーパークラスを拡張する Rectangle.prototype = Object.create(Shape.prototype, { // Rectangle.prototype.constructor を Rectangle に設定しな



2015/06/30 リンク