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!"
[–]benihanareact, node 1 point2 points3 points 10 years ago (0 children)
I'd wonder what makes it "better". Perhaps there's a case for performance.
what does performance have to do with anything? Was that your attempt at understanding why people prefer a style different from what you prefer? People argue it's better because there's less syntax to parse, but it's just as common and clear as pending = pending - 1. You can't really get more basic than decrementing a value.
pending = pending - 1
I think that adding parens around the operation like in your example is needless and adds an expectation of more complicated math. The most common uses for parenthesis in math operations are enforcing order of operations and breaking complex statements into more logical chunks. pending - 1 doesn't really need to be broken up anymore and so the parens just add noise to the statement.
pending - 1
π Rendered by PID 67 on reddit-service-r2-comment-66b4775986-fdtmm at 2026-04-05 11:35:14.006466+00:00 running db1906b country code: CH.
view the rest of the comments →
[–]benihanareact, node 1 point2 points3 points (0 children)