ES6小记

1.

`${}`
`string` 是模板字符串,ES2015新增的符号。
其实是这样的 ${}里边 依旧是js,外边也是js 
var a = 1;
console.log('一共有'+a+'个鸡蛋!')
那么现在你只要
console.log(`一共有${a}个鸡蛋!`)

猜你喜欢

转载自blog.csdn.net/a976134036/article/details/79640264
ES6