1
我在學習ECMAScript6的es6katas.org,這是非常好的和強烈推薦。我目前卡在this關於箭頭功能的非常基本的kata。我似乎無法理解作者在什麼第二次測試的意思是:es6katas.org卡塔#6:箭頭函數 - 綁定
class LexicallyBound {
getFunction() {
return() => {
return new LexicallyBound();
}
}
getArgumentsFunction() {
return function() {return arguments}
}
}
it('bound at definition time, use `=>` ', function() {
var bound = new LexicallyBound();
var fn = bound.getFunction();
assert.strictEqual(fn(), bound);
});
有人能幫助想出來的?
請填寫'LexicallyBound'代碼。現在添加 – Sheepy
,感謝您的評論 – tome