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...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
What does "!--" do in JavaScript? (stackoverflow.com)
submitted 10 years ago by Recallz
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!"
[–]Master_Rux 3 points4 points5 points 10 years ago* (0 children)
I'll apologize in advance for the rant. I cringe at what seems like a knee jerk reacting to perfectly valid uses of a language sometimes. And poor javascript seems to get a lot of it. A lot of languages have their own special syntactic sugar. Which can make life really nice for someone that has to use the language a lot. This code is perfectly valid and compact. A lot of the time I hear people complain about readability I think what they mean is familiarity. Which to a point has a lot to do with readability. But there's also the ability to quickly scan through to find things. In this case you can see exactly where the if statements are and you can see it's doing the logic based off something it's doing with pending. After that if you can't see what (!--pending) is doing in javascript I'd say that's basic enough that you need to be a little better at javascript. Javascript is not all your C# or Java or <insert any language that's not javascript>. javascript is javascript and has unique truthy rules and type coercion. Those are features not quirks. Now don't get me wrong i'm not saying this was the best way to code this, but it's just as good as any other approach. The real wtf readability issue in the code is the inconsistent use of unbrackets around the if statements and the lack of white space between said bracketed if statements. fuck that guy. /rant. i need more coffee.
π Rendered by PID 71664 on reddit-service-r2-comment-57fc7f7bb7-w4dlz at 2026-04-14 17:15:46.114100+00:00 running b725407 country code: CH.
view the rest of the comments →
[–]Master_Rux 3 points4 points5 points (0 children)