Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Nope:

TypeError: document.getElementsByTagName("p").filter is not a function

Because you don't get an array, only something array-like.



And this discussion over how to write a trivial loop is why I stay far away from vanilla js unless performance absolutely forces me to optimize.


This is why I program with a code editor / interactive console that tells me these things as I'm typing :-)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: