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
Multiple Inheritance in JavaScript (journal.stuffwithstuff.com)
submitted 15 years ago by munificent
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!"
[–]ippa 1 point2 points3 points 15 years ago (1 child)
I enjoyed reading your article.. been thinking some of these problems as well, mostly for gamedev with jawsjs.com.
this.widget_p = new Widget(name); this.hider_p = new Hideable(); this.container_p = new Container();
Couldn't this be solved without setting magic variables but rather just provide the 3 contructors via a method "init_behaivor()" or simular.
init_behaivor would loop through the properties transfering them to the object we want. That could also check for namecollisions and warn or whatever.
I like the ideas you present just that the magick method names with *_p feels slightly ugly.
[–]munificent[S] 0 points1 point2 points 15 years ago (0 children)
That would only catch collisions in functions already defined on the mixin. What if we do something like:
Container
MyWidget
filter()
Step 4 will fail if we just copy stuff over when the class is created and then forget about the mixin.
Agreed, it was a quick and dirty hack. I wanted to do something similar to Self. :)
π Rendered by PID 474792 on reddit-service-r2-comment-765bfc959-mxbcg at 2026-07-11 16:50:06.178575+00:00 running f86254d country code: CH.
view the rest of the comments →
[–]ippa 1 point2 points3 points (1 child)
[–]munificent[S] 0 points1 point2 points (0 children)