es6中允许使用``创建字符串模块,可以直接写回车空格编写html或文本。
可代替‘’和“”的使用
let html = `
<div>
<p>hahaha</p>
</div>
`
在 ‘ ‘ 中 可 以 使 用 {} 在``中可以使用 在‘‘中可以使用{}直接把变量与字符串拼起来,无需使用加号
let search = 1;
//es5中
let url="www.baidu.com?search="+search;
//es6中
let url=`www.baidu.com?search=${search}`;