↓推荐关注↓新特性ES6(2015)1. 类(class)class Man { constructor(name) { this.name = '小豪'; } console() { console.log(this.name); }}const man = new Man('小豪');man.console(); // 小豪2. 模块化(ES Module)// 模块 A 导出一个方法export const sub = (a, b) => a + b;// 模块 B 导入使用import { sub } from './A';console.log(sub(1, 2)); // 33. 箭头(Arrow)函数const func = (a, b) => a + b;func(1, 2); // 34. 函数参数默认值function foo(age = 25,){ // ...}5. 模板字符串const name = '小豪';const str = `Your name is ${name}`;6. 解构赋值let a = 1, b= 2;[a, b] = [b, a]; // a 2 b 17. 延展操作符let a = [...'hello world']; // ["h", "e", "l", "l", "o", " ", "w", "o", "r", "l", "d"]8. 对象属性简写const name='小豪
………………………………