ES6笔记
rest参数
<script>
const sum = (...args) => {
let total = 0;
args.forEach(value => total += value)
return total;
};
console.log(sum(10, 20));
console.log(sum(10, 20, 30));
</script>
<script>
let ary1 = ['张三','李四.
原创
2021-08-13 16:01:40 ·
86 阅读 ·
0 评论