P
//es5 var self = this; this.nums. forEach ( function (v) { if (v % 5 === 0 ) self .fives.push(v); }); //es6 this.nums. forEach ((v) => { if (v % 5 === 0 ) this.fives.push(v) }) http://es6-features.org/#Lexicalthis
CommentThreadMar 28, 20162How to differentiate between a function expression and a function declaration using ES6 arrow functions?