当前位置:网站首页>Curry realization of function continuous call calculation and accumulation
Curry realization of function continuous call calculation and accumulation
2022-04-23 06:53:00 【zjLOVEcyj】
function curry(...args) {
let parmas = args
function sum() {
parmas = [...parmas, ...arguments]
return sum
}
sum.toString = function () {
return parmas.reduce((prev, cur) => {
return prev + cur
})
}
return sum
}
console.log(curry(1)(2)(3)(10)(10, 20).toString())
Front end classic interview questions
Coriolis function A function that will add up sum(a,b,c,d) Into something that can be called indefinitely sum(a)(b)(d)…
版权声明
本文为[zjLOVEcyj]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230555334231.html
边栏推荐
猜你喜欢
随机推荐
fdfs启动
New type of dark energy could solve Universe expansion mystery
.Net Core 下使用 Quartz —— 【5】作业和触发器之触发器的通用属性和优先级
PHP unlimited classification and tree
.Net Core 下使用 Quartz —— 【7】作业和触发器之简单触发器
NodeJS 模块之间的使用
若依如何input改成文本
时间格式不对,运行sql文件报错
Centos8 builds php8 0.3 operating environment
出入库与库存系统的模型问题
压力测试工具 Jmeter
Sum (if) in MySQL_ Sum (if ()) in MySQL
七牛上传图片(前台JS+后台C#API获取token)
数据可视化基础了解
The time format is incorrect, and an error is reported when running the SQL file
启用AHCI后无法启动系统
关于软件的空间占用,安装目录
不用登录直接下载PNG图标的一个网站
.Net Core 下使用 Quartz —— 【4】作业和触发器之作业属性和异常
条形码与二维码的生成