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);
let const 没有变量提升
let 块级作用域
const 常量
function sum(...n){
let total = 0;
for(let i of n){
total += i;
}
console.log(`total:${total}`);
}
sum(3,4,5,6);