遍歷器接口
ES6 為字符串添加了遍歷器接口,使得字符串可以被for...of循環(huán)遍歷。
模板字符串
模板字符串用反引號(hào)(`)標(biāo)識(shí)。它可以當(dāng)作普通字符串使用,也可以用來(lái)定義多行字符串,或者在字符串中嵌入變量或表達(dá)式。

示例
新增的實(shí)例方法(部分)
includes、startWith、endWith;
repeat;
padStart、padEnd;
trimStart、trimEnd;
ES6 為字符串添加了遍歷器接口,使得字符串可以被for...of循環(huán)遍歷。
模板字符串用反引號(hào)(`)標(biāo)識(shí)。它可以當(dāng)作普通字符串使用,也可以用來(lái)定義多行字符串,或者在字符串中嵌入變量或表達(dá)式。
includes、startWith、endWith;
repeat;
padStart、padEnd;
trimStart、trimEnd;