js中的 ` 作用

` 是ES6中的新特性,拼接字符串的时候可以直接使用变量。

如:

var str = "2020" ;

`hello ${str} world !`

posted @ 2021-07-13 17:48  xie风细雨  阅读(1689)  评论(0编辑  收藏  举报