2016-08-06 12 views

答えて

1

Arrayにはmethod()はありません。 ダグラス・クロフトフォードの投稿では、彼はその方法を自分で作成して使用しています。

これは、あなたが20ページの "単純なテスト・グラウンド" というタイトルのセクションを読み取るために必要なコード

Object.prototype.method = function (name, func) { 
    this.prototype[name] = func; 
    return this; 
}; 
1

です:

Throughout the book, a method method is used to define new methods. This is its definition:

Function.prototype.method = function (name, func) { 
    this.prototype[name] = func; 
    return this; 
}; 

It will be explained in Chapter 4.

関連する問題