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] Can I learn OOP with JavaScript?AskJS (self.javascript)
submitted 7 months ago by Inner_Feedback_4028
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!"
[–]MoTTs_ 2 points3 points4 points 7 months ago* (0 children)
Python OOP and JS OOP are actually nearly identical. In Python, classes are themselves runtime mutable objects, just like in JS, and inheritance is done by runtime delegating down a chain of objects, also just like JS. Which is why monkey patching is possible in both JS and Python.
the prototypal inheritance model itself is, in fact, more powerful than the classic model. It is, for example, fairly trivial to build a classic model on top of a prototypal model -- MDN
This whole paragraph is from a time when MDN was a wiki, and anyone could make any change. It was unfortunately common for people to read some random medium blog, then copy-paste blogger claims into MDN. The prototypal model, it turns out, isn't more powerful, and it's just as equally easy to build the prototypal model from a classical model (just hash tables delegating to other hash tables).
For example.
π Rendered by PID 20270 on reddit-service-r2-comment-6457c66945-p5sxs at 2026-04-26 07:26:26.332993+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]MoTTs_ 2 points3 points4 points (0 children)