1.字符串的遍历接口
1)在ES6中,字符串可以进行for…of循环
for (let codePoint of 'foo') {
console.log(codePoint)
}
// "f"
// "o"
// "o"
2.模板字符串
在不使用模板字符串的时候,我们一般使用字符串的拼接(Jquery)
$('#result').append(
'There are <b>' + basket.count + '</b> ' +
'items in your basket, ' +
'<em>' + basket.onSale +
'</em> are on sale!'
);
在有了模板字符串之后,我们可以这么写
$('#result').append(`
There are <b>