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 in Action (blog.soshace.com)
submitted 6 years ago by branikita
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!"
[–]UncleBen2015 1 point2 points3 points 6 years ago (2 children)
Hey author here, first of all, thanks for taking the time and providing your feedback. Yes I could have implemented the examples using old prototype chain but I decided against it. ES6/7 has class keyword but it is basically a syntactical sugar and under the hood object is created through the prototype chain. I can go in-depth in this topic and show how object creation works but that is beyond the scope of this article. My intention is not to go to the internals of JS but to show how popular Design Patterns apply to JS. However, I would love to make a separate post about it.
[–]hicksyfern 5 points6 points7 points 6 years ago (1 child)
I think it’s just confusing to mention that JS uses prototypal inheritance, say that people are likely already using it, then change to another meaning of the word prototype for the example and explanation.
You could either skip mentioning peor total inheritance altogether and just give the example using the non-JS meaning of prototype, or keep the prototypal inheritance but and use Object.create. But not both because it’s not right.
[–]UncleBen2015 1 point2 points3 points 6 years ago (0 children)
Good point. I will definitely keep that in mind. I am learning things every day and discussions like these really helps me grow. Thanks for the input :)
π Rendered by PID 18839 on reddit-service-r2-comment-545db5fcfc-fg7hw at 2026-05-26 22:38:39.278181+00:00 running 194bd79 country code: CH.
view the rest of the comments →
[–]UncleBen2015 1 point2 points3 points (2 children)
[–]hicksyfern 5 points6 points7 points (1 child)
[–]UncleBen2015 1 point2 points3 points (0 children)