ES6 Arrow Functions (ok)
https://viblo.asia/p/es6-arrow-functions-QpmleLr9Zrd
ES6 Arrow Functions
Mở đầu
Arrow function là gì
Cách dùng arrow function
Trong trường hợp nhiều tham số
// (param1, param2, paramN) => expression
// ES5
var multiply = function(x, y) {
return x * y;
};
// ES6
var multiply = (x, y) => { return x * y };Trong trường hợp 1 tham số
Trong trường hợp không có tham số
Cú pháp với Object literal
Khi nào thì nên sử dụng arrow function
Promises và Callbacks
Lưu ý trong việc sử dụng arrow function
this
thisConstructors
Generators
Nguồn tham khảo
Last updated