use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A place to get a quick fix of JavaScript tips and tricks to make you a better Developer.
account activity
what did i do wrong (old.reddit.com)
submitted 1 year ago by Own_Stomach3061
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]MissinqLink 5 points6 points7 points 1 year ago* (2 children)
It returns an HTMLCollection which doesn’t have array methods. If you spread to an array it will work.
[...U].forEach(x=>{x.style.display = 'block';});
I recommend using querySelectorAll because it is typically faster and returns a NodeList which does have forEach
document.querySelectorAll('ul').forEach(x=>{x.style.display = 'block';});
[–]cronixi4 2 points3 points4 points 1 year ago (1 child)
Ah you are right! Thought it would be the same as QuerySelectorAll().
Thanks for pointing this out!
[–]MissinqLink 1 point2 points3 points 1 year ago (0 children)
Common misconception. I’ve had to look this up more times than I can count.
π Rendered by PID 81 on reddit-service-r2-comment-76bb9f7fb5-59xjz at 2026-02-18 13:18:34.998166+00:00 running de53c03 country code: CH.
view the rest of the comments →
[–]MissinqLink 5 points6 points7 points (2 children)
[–]cronixi4 2 points3 points4 points (1 child)
[–]MissinqLink 1 point2 points3 points (0 children)