Hacker News new | ask | show | jobs
by polote 3202 days ago
you can't use forEach with a NodeList ;)
2 comments

Easiest solution is to wrap the NodeList with Array.from(...) first. Just wanted to point out how handy that function is.

Also if we're going to make a snazzy one-liner, let's cut out the unused arguments:

  Array.from(document.querySelectorAll("td.subtext")).forEach(currentValue => { currentValue.hidden = true; });
JS's lack of macros strikes again.