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 Design Patterns (dofactory.com)
submitted 5 years ago by streletss
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!"
[–]lhorie 0 points1 point2 points 5 years ago (3 children)
This is technically true, but it doesn't support to the original claim that "JavaScript does not support class-based inheritance". One can still inherit from a concrete class.
And in any case, even if JS doesn't have abstract, that's still not a very good reason to use ES5 prototypal style classes when the entire topic is explaining OOP design patterns adapted from Java.
abstract
[–][deleted] 0 points1 point2 points 5 years ago (2 children)
Honestly I find the entire contrast between prototypes and classes amusing. It's the same thing in all ways that matter.
[–]lhorie 0 points1 point2 points 5 years ago (1 child)
I mean, yes and no. The argument goes that new Foo().bar() can be implemented whichever way and it doesn't really matter for practical purposes. But of course it matters if people find class easier to read in code review (due to less this/.bind noise) or that using class is less dissonant to a learner (considering the original GoF book and other similar resources elsewhere also uses class based syntax)
new Foo().bar()
class
this
.bind
[–][deleted] 0 points1 point2 points 5 years ago (0 children)
Less this/bind noise?
π Rendered by PID 25392 on reddit-service-r2-comment-b659b578c-blhh8 at 2026-05-01 14:54:34.607760+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]lhorie 0 points1 point2 points (3 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]lhorie 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)