Skip to content

Commit

Permalink
Merge pull request #1 from ruanyf/gh-pages
Browse files Browse the repository at this point in the history
merge
  • Loading branch information
new9xgh committed Nov 21, 2018
2 parents 44b4886 + 8eb7a69 commit 5e71c78
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/array.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ let nodeList = document.querySelectorAll('div');
let array = [...nodeList];
```

上面代码中,`querySelectorAll`方法返回的是一个`nodeList`对象。它不是数组,而是一个类似数组的对象。这时,扩展运算符可以将其转为真正的数组,原因就在于`NodeList`对象实现了 Iterator 。
上面代码中,`querySelectorAll`方法返回的是一个`NodeList`对象。它不是数组,而是一个类似数组的对象。这时,扩展运算符可以将其转为真正的数组,原因就在于`NodeList`对象实现了 Iterator 。

对于那些没有部署 Iterator 接口的类似数组的对象,扩展运算符就无法将其转为真正的数组。

Expand Down

0 comments on commit 5e71c78

Please sign in to comment.