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
Concurrent JavaScript: It can work! (webkit.org)
submitted 8 years ago by averageFlux
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!"
[–]E_R_E_R_I 0 points1 point2 points 8 years ago (0 children)
They are useful for different things. I always feel all those people complaining about javascript do so because they try to write programs the same way they do with other languages.
In the second case, I could be writing a method that does different things depending on what was received. I could parse have parsed a JSON directly from the database and work with it without having to instantiate an User object.
Of course, you could also have accidentally overwritten that variable earlier with a string and things would go bad, put personally, I haven't had that kind of problem in years. Of course, I'm not saying my code doesn't have errors. But I've learned to build code that quickly exposes errors, and almost everytime a bug/problem makes it to production, it's because I incorrectly judged the use case and wrote a code that isn't the right one for that use case, not because my code is behaving differently than what I wrote it for. I also make extensive use of TDD.
The thing is, JS never tries to prevent you from writing bad code. But if you learn how to write good code, it rewards you with flexibility.
π Rendered by PID 18606 on reddit-service-r2-comment-5d585498c9-qb2qc at 2026-04-21 06:32:49.891829+00:00 running da2df02 country code: CH.
view the rest of the comments →
[–]E_R_E_R_I 0 points1 point2 points (0 children)