ES6-模板字符串

135 阅读1分钟
利用jq库
字符串内部变量可以用$(变量),不用写‘+’和引号,更加方便
var type = 'singleline';
'This is a ' + type + ' string '

`This is a ${type} string.`