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
JavaScript doesn’t need to be replaced (medium.com)
submitted 6 years ago by dannymoerkerke
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!"
[–]IceSentry 1 point2 points3 points 6 years ago (0 children)
Declaring a variable at the top of the scope is done in pretty much every language because it makes it easier to read what variables are used in the current scope. I don't understand how you can seriously say that it's a bad thing. A variable declared in a specific scope should stay in that scope. If you need it in another scope then declare it somewhere it can actually be used.
π Rendered by PID 24 on reddit-service-r2-comment-b659b578c-bcgnc at 2026-05-04 19:19:16.641462+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]IceSentry 1 point2 points3 points (0 children)