###概要
あるホームページを調べていて、
"bind" in Function.prototype || (Function.prototype.bind
という構文が出てきました。
javascriptでbindの使い方がわかりません。
"bind" in Function.prototype と(Function.prototype.bind..
の論理式ってどういうことでしょうか?
また、この宣言文でprototype.bindされたものはどのような挙動をするのでしょうか?
よろしくお願いいたします。
###ソース
javascript
1var hoge1,hoge2,hoge3; 2"bind" in Function.prototype || (Function.prototype.bind = function () { 3 var a = this, b = Array.prototype.slice.call(arguments), c = b.shift(); 4 return function () { 5 return a.apply(c, b.concat(Array.prototype.slice.call(arguments))); 6 }; 7}); 8 9function hoge1() { 10... 11} 12hoge1.prototype = { 13} 14 15function hoge2() { 16... 17} 18hoge2.prototype = { 19} 20 21function hoge3() { 22... 23} 24hoge3.prototype = { 25}
質問文のコードはそれぞれコードブロックで囲んでいただけませんか? ```(バッククオート3つ)で囲み、前後に改行をいれるか、コードを選択して「<code>」ボタンを押すとコードブロックになります。

回答1件
あなたの回答
tips
プレビュー