mirror of
https://github.com/yangshun/tech-interview-handbook.git
synced 2025-07-10 22:52:33 +08:00
Update dom.md
This commit is contained in:
@ -86,7 +86,7 @@ A `NodeList` can contain any node type, but an `HTMLCollection` is supposed to o
|
||||
|
||||
**How do you convert an `HTMLCollection` or `NodeList` into an array?**
|
||||
|
||||
```
|
||||
```js
|
||||
const nodelist = document.querySelectorAll('div');
|
||||
// Array.from
|
||||
const divArray = Array.from(nodelist);
|
||||
|
Reference in New Issue
Block a user