箭頭符號 2018-05-02
const x = (x) => (y) => (z) => x * y * z;
console.log(x(1)(2)(3));
相當於
const y = function(x) {
return function(y) {
return function(z) {
return x * y * z;
}
}
}
console.log(y(1)(2)(3));
值可往內傳遞
const x = (x) => (y) => (z) => x * y * z;
console.log(x(1)(2)(3));
相當於
const y = function(x) {
return function(y) {
return function(z) {
return x * y * z;
}
}
}
console.log(y(1)(2)(3));
值可往內傳遞