语法: export * from "foo"; export {foo} from "foo"; export {foo, bar} from "foo"; export {foo as bar} from "foo"; export {foo as default} from "foo"; export {foo as default, bar} from "foo"; export
函数写法区别 计算a, b两个数字之和,有返回值 es5 写法 function add(a, b) { return a + b; } es6 写法(箭头函数) let add = (a, b) => { return a + b } 注意: 箭头函数作用于执行代码,这时使用{} let add = (a, b) => {a + b} 当执行的代码语句只有一个逻辑表达式,这时可以省略{} let add = (a, b) => a + b 箭头函数用于返回对象时,这时使用() let