字符串拼接
let str1 = "hello";
let str2 = "es6";
let str = `${str1} my ${str2}`
// str = "hello my es6"
字符串换行
let html = `<div class="box">
<span class="icon">你好</span>
</div>`;
对象初始化简写
(a,b,c)=>({
a,
b,
c
})
//等同于
function(a,b,c){
return {
a:a,
b:b,
c:c
}
}
对象字面量简写
var obj = {
a:100,
b(){
console.log(this.a);
}
}