<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
</body>
</html>
<script type="text/javascript">
var a = [1,2,3,4,5];
function add(total,x,index,a){
total += x;
return total;
}
var x = a.reduce(add);
console.log(x)
</script>
jsES5新方法累加器
最新推荐文章于 2024-05-27 21:40:46 发布