标签:style val log alert sum index class value 区别
var values = [1,2,3,4,5] var sum = values.reduce(function(pre,cur,index,array){ return pre + cur }) alert(sum) // 15
reduceRight()与reduce()的区别是从右往左
标签:style val log alert sum index class value 区别
原文地址:http://www.cnblogs.com/cnundefined/p/7109610.html