字符串类型
//多行字符串 let title = `aaa bbb ccc`; console.log(title) //字符串模板 let myname = 'world'; let age = function () { return 18; } console.log(`hello ${myname}`); console.log(`${age()}`); //自动拆分字符串 function test(template,name,age) { console.log(template); console.log(name); console.log(age); } let myname_a = 'bbb'; let getAge = function () { return 18; } // test`my name is ${myname_a},i'm${getAge()}`; test`${myname_a},${getAge()}`;