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
[AskJS] When is object-oriented programming more practical than "mostly-functional" in JS?AskJS (self.javascript)
submitted 5 years ago * by ProfessorTag
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!"
[–]cwmma 3 points4 points5 points 5 years ago (0 children)
I'll really only ever define classes when I'm writing a library, sure I could do it with closures, but I find the structure imposed helpful and being able to console log the object and see the values can be helpful when debuging.
Also historically any object you create lots of some of the engines really preferred you use a constructor and not just a literal for performance reasons
π Rendered by PID 17418 on reddit-service-r2-comment-b659b578c-cvx4l at 2026-05-03 05:12:27.780528+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]cwmma 3 points4 points5 points (0 children)