标签:特性 blog bbb 表达 ons str hello script esc
var string = `aaa
bbb
ccc`;
var string = "aaa";
var getString = function(){
return "aaa";
}
console.log(`hello ${string}`); // "hello aaa"
console.log(`hello ${getString()}`); // "hello aaa"
function hello (template, name, age) {
console.log(template);
console.log(name);
console.log(age);
}
var myName = "张三";
var getAge = function () {
return 18;
}
hello`Hello, my name‘s ${myName}, i‘m ${getAge()}`;
标签:特性 blog bbb 表达 ons str hello script esc
原文地址:http://www.cnblogs.com/joffe/p/7702585.html