问:Array.reduceRight()基本用法
七娃博客
310人阅读
reduceRight() 方法的功能和 reduce() 功能是一样的,不同的是 reduceRight() 从数组的末尾向前将数组中的数组项做累加。
const list = [1, 2, 3, 4, 5]; list.reduceRight((total, item) => total + item, 0); // 15
主题开源不易,支持一下作者吧!
使用支付宝打赏
使用微信打赏
评论 | 0 条评论
登录之后才可留言,前往登录