es6 模板字符串

模板字符中,支持字符串插值:

let first = 'hubwiz';
let last = '汇智网';
document.write(`Hello ${first} ${last}!`);
// Hello hubwiz 汇智网!

模板字符串可以包含多行:

let multiLine = `
    This is
    a string
    with multiple
    lines`;
    document.write(multiLine);  

  

posted @ 2017-12-13 14:29  年少的你如此美丽  阅读(110)  评论(0编辑  收藏  举报