ES6

2017-07-29  本文已影响0人  zzj_alpaca

let const

let const 没有变量提升
let 块级作用域
const 常量

模板语言, restfu

 function sum(...n){
        let total = 0;
        for(let i of n){
            total += i;
        }
        console.log(`total:${total}`);
    }
    sum(3,4,5,6);
上一篇 下一篇

猜你喜欢

热点阅读