学习笔记
目录
一.var let const 异同.................................................................................................................2
二、let const 的应用................................................................................................................2
2.1 应用于 for 循环中(let)..............................................................................................2
2.2 使用 const let var 的先后级...........................................................................................3
三、箭头函数..........................................................................................................................3
3.1 使用方法........................................................................................................................3
3.2 箭头函数的 this..............................................................................................................4
3.3 ES6 默认值......................................................................................................................4
3.4 箭头函数不适用场景.....................................................................................................4
3.4.1 作为构造函数,一个方法需要绑定到对象..........................................................4
3.4.2 真正需要 this 值......................................................................................................5
3.4.3 使用 arguments.......................................................................................................5
四、ES6 字符串模板................................................................................................................5
4.1 字符串模板....................................................................................................................5
4.2 字符串模板实列.............................................................................................................6
4.3 标签模板........................................................................................................................6
4.4 字符串函数....................................................................................................................7
4.4.1 startsWith................................................................................................................7
4.4.2 endsWith..................................................................................................................7
4.4.3 .includes...................................................................................................................8
4.4.4 .repeat......................................................................................................................8
4.5 ES6 对象解构..................................................................................................................8
4.6 数组解构......................................................................................................................10
五 ES6 for 和 Array.................................................................................................................10
5.1 for of 讲解.....................................................................................................................10
5.2 for of 的使用示例........................................................................................................11
5.3 Array from 和 Array of..................................................................................................12
5.4 Array 使用方法.............................................................................................................13
5.4.1 .#nd()......................................................................................................................13