ES6初学2
1.Class类通过class的形式添加class Num{ constructor(...args){ for( let i in args ){ this[i]=args[i]; } } add(){ let total=0; for( let i in this )
1.Class类通过class的形式添加class Num{ constructor(...args){ for( let i in args ){ this[i]=args[i]; } } add(){ let total=0; for( let i in this )
1.新增关键词let和const### let和const声明的是块级作用域 let a=0; { let a=1; } console.log(a) // 0 var a=1; { var a=1; } console.log(a) // 0 //假设有5个button标签 var allBtns=document.querySelect