遍历器接口
ES6 为字符串添加了遍历器接口,使得字符串可以被for...of循环遍历。
模板字符串
模板字符串用反引号(`)标识。它可以当作普通字符串使用,也可以用来定义多行字符串,或者在字符串中嵌入变量或表达式。
示例
新增的实例方法(部分)
includes、startWith、endWith;
repeat;
padStart、padEnd;
trimStart、trimEnd;
ES6 为字符串添加了遍历器接口,使得字符串可以被for...of循环遍历。
模板字符串用反引号(`)标识。它可以当作普通字符串使用,也可以用来定义多行字符串,或者在字符串中嵌入变量或表达式。
includes、startWith、endWith;
repeat;
padStart、padEnd;
trimStart、trimEnd;