update: 模板字符串

This commit is contained in:
qianguyihao
2020-08-25 20:47:55 +08:00
parent 516051b422
commit bae724f3bd
6 changed files with 204 additions and 240 deletions

View File

@@ -200,3 +200,11 @@ console.log(arr1); // ["王一", "王二", "王三", "王四", "王五", "王六
const myDivs = document.getElementsByClassName('div');
const divArr = [...myDivs]; // 利用扩展运算符,将伪数组转为真正的数组
```
**补充**
我们在JavaScript基础/数组的常见方法中也学过还有一种方式可以将伪数组或者可遍历对象转换为真正的数组语法格式如下
```js
let arr2 = Array.from(arrayLike);
```