扫码关注官方订阅号
请问一下
const clamp = min => max => n => Math.max(min, Math.min(max, n));
这一句是什么意思,符号=>只是单纯的大于等于的意思么?
学习是最好的投资!
=> 是 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)); } } }
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
=>是 ES6 中的新特性 —— 箭头函数。