アロー関数
アロー関数(Arrow Functions)
var inc = (x)=>x+1;function Person(age) {
this.age = age;
this.growOld = function() {
this.age++;
}
}
var person = new Person(1);
setTimeout(person.growOld,1000);
setTimeout(function() { console.log(person.age); },2000); // 1, should have been 2Tip:アロー関数の必要性
Tip:アロー関数の危険性
Tip:thisを使用するライブラリのアロー関数
thisを使用するライブラリのアロー関数Tip:アロー関数と継承
Tip:Quick Object Return
最終更新