3 ms·
This also works, by the way: [...document.querySelectorAll('p')].map(f) In the future, NodeList could extend Array which would make these workarounds redu
by tomatsu 10y ago
This also works, by the way:
[...document.querySelectorAll('p')].map(f)
In the future, NodeList could extend Array which would make these workarounds redundant. Extending Array was made possible by ES6.
Anyhow, I think having some kind of extension methods would be great.
- gsnedders 10y ago> In the future, NodeList could extend Array which would make these workarounds redundant. It would break the web, unfortunately. (We've experimented with NodeList.prototype.__proto__ being Array.prototype instead of Object.prototype and it breaks sites, and ES6's extends notion implies that.)