请问一下const clamp = min => max => n => Math.max(min, Math.min(max, n));这一句是什么意思,符号=>只是单纯的大于等于的意思么?
1 回答
慕尼黑8549860
TA贡献1818条经验 获得超11个赞
=> 是 ES6 中的新特性 —— 箭头函数。
const clamp = min => max => n => Math.max(min, Math.min(max, n));
// 等价于
const clamp = function (min) { return function (max) { return function (n) {
return Math.max(min, Math.min(max, n));
}
}
}添加回答
举报
0/150
提交
取消
