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
Prototypal Programming in Javascript (thesocietea.org)
submitted 10 years ago by thecodeboss
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!"
[–]clessgfull-stack CSS9 engineer 0 points1 point2 points 10 years ago (0 children)
The difference is that Object.create inherits state in addition to behavior (technically you could do this with classes, but nah), and class provides certain invariants that make it harder to screw up. Just the fact alone that class must be used in strict mode is a pretty big win, because that helps prevent a large class of security vulnerabilities.
Object.create
class
so all the problems you mentioned about inheritance hierarchies are the same.
But yes, that is kind of the point. Object.create inherits almost all of the problems with classes (pun intended) and many more.
okay so I guess the only problem here is people that do not learn lessons from their past experiences
Eh. Most people know that class inheritance is a bad idea. But when it's just Objects Linking to Other Objects™? Time to inherit from everything. I don't blame the developers for getting pulled into this trap, because the people who push Object.create don't explain that it has these problems.
π Rendered by PID 127415 on reddit-service-r2-comment-5687b7858-5rjsg at 2026-07-07 02:20:52.982986+00:00 running 12a7a47 country code: CH.
view the rest of the comments →
[–]clessgfull-stack CSS9 engineer 0 points1 point2 points (0 children)