CommentMar 28, 20162
//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
@PikaboyZ
Developer, Programmer, PHP, JS, AngularJS, MongoDB, Wordpress
Nothing here yet.
Nothing here yet.
No blogs yet.
//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