DEV Community

Discussion on: Webdev WTF

Collapse
 
dz4k profile image
Deniz Akşimşek
Object.setPrototypeOf(NodeList.prototype, Array.prototype)
Enter fullscreen mode Exit fullscreen mode

Thank me later :)

Collapse
 
vfonic profile image
Viktor

What the...? :D I'm only guessing what that does, but if we weren't talking about this, I don't think I'd ever guess.

...Thank you! :)

Collapse
 
adam_cyclones profile image
Adam Crockett 🌀

Idiomatic JavaScript, they say don't modify objects that you don't own, so I feel this is a bit of a sledge hammer really. Besides Array.from(someNodeList) does just fine.