新特性:模板字符串
传统字符串
let name = Jacky;
let occupation = doctor;
//传统字符串拼接
let str = He is + name +,he is a + occupation;
es6简洁的字符串拼接
let name = Jacky;
let occupation = doctor;
//模板字符串拼接
let str = `He is ${name},he is a ${occupation}`;
对比两段拼接的代码,模板字符串使得我们不再需要反复使用双引号(或者单引号)了;而是改用反引号标识符(`),插入