默认值 function test(x,y='world'){ console.log('默认值'); } function test2(...arg){ for(let v of arg){ console.log("rest",v); } } test2(1,2,3,4,5,'a'); 箭头函数 let arrow =v=>v*2; console.log('arrow',arrow(3));//6 尾调用---性能优化的过程中,嵌套过多 function tail(x)…
Symbol的概念 变量是独一无二的 let a1=Symbol(); let a2=Symbol(); a1和a2严格意义不相等 let a3=Symbol.for('a3'); let a4=Symbol.for('a3'); console.log(a3===a4); 如果在对象中使用Symbol变量,就可以用Object.getOwnPropertySymbols(obj).forEach(function(tiem){ }) or Reflect.OwnKeys(obj…
export let A=123; export function test(){ console.log('test'); } export class Hello(){ test(){ console.log('class'); } } import (A,test,Hello) from './class/lesson' or import * as lesson from ''./class/lesson' export 导出 import 导入 or other M…