$('body').childNodes.forEach(console.log)
NodeList exposes exactly 5 methods: item, entries, forEach, keys, and values.
Very beautiful.
BTW, browsers didn't even add forEach to it until several years after they added document.querySelectorAll lol
Edit. https://caniuse.com/?search=nodelist
NodeList appeared in 2006(Firefox) - 2008 (Safari) - 2010 (Chrome)
forEach on it appeared in... 2016.
NodeList exposes exactly 5 methods: item, entries, forEach, keys, and values.
Very beautiful.
BTW, browsers didn't even add forEach to it until several years after they added document.querySelectorAll lol
Edit. https://caniuse.com/?search=nodelist
NodeList appeared in 2006(Firefox) - 2008 (Safari) - 2010 (Chrome)
forEach on it appeared in... 2016.