跳到主要內容

【Javascript系列】 - 樣板字串 String Template

 樣板文字用反引號表示: ``, 如下:

const html = '<div>' 
    + template.link
    + '</div>';

等同於

const html = `<div>
                ${template.link}
              </div>`

留言