自己编个小例子
class people{//创建父类 constructor(){ this.name="peoplename"; this.sex="peoplesex"; this.age="100"; }, buildpeople(who){ console.log(who+"buiold"+this.name+"sex:"+this.sex+"age:"+this.age) } } let people=new people() people.buildpeople("god") class lijinlong extends people(){//子类继承父类 constructor(){ super(); this.name="lijinling"; this.sex="man"; this.age="24"; } } let lijinling = new lijinlong(); lijinling.buildpeople("parents"); arrow function(箭头函数)\ (参数)=>{函数主体} template string(模板字符串插入) 通常的字符串拼接变量为:"wodemingzi"+name+" es6可以这样 `wodemingzi${name}` 用反引号标示起始,用${}包裹变量 destructuring解构? let cat = 'ken' let dog = 'lili' let zoo = {cat, dog} let dog = {type: 'animal', many: 2} let { type, many} = dog console.log(type, many) //animal 2 个人感觉和with很像,直接将键名拿出来就能取到值 default默认值 可以直接在函数参数设置默认值 function li(name="lijinlong"){ console,.log(name) } li();