1.块级作用域
(1)let 取代 var
(2)全局常量和线程安全
2.字符串

3.解构赋值
4.对象




5.数组
1)使用 扩展运算符(...) 拷贝数组
2)Array.from将类似数组的对象转化为数组
6.函数
1)尽量使用箭头函数(简单的、单行的、不会复用的函数,建议采用箭头函数。如果函数体较为复杂,行数较多,还是应该采用传统的函数写法)



8.Class


9.模块
1)使用import代替require
2)使用export代替module.exports
3)如果模块只有一个输出值,就使用export default;
如果模块有多个输出值,就不使用export default;
export default与普通的export不要同时使用

10.ESLint的使用
--语法规则和代码风格的检查
网友评论