Re:The world's smallest and fastest classical JavaScript inh...
by rattray on Saturday February 15, 2014 @01:37PM
(#7244729)
Would anyone mind annotating jashkenas' version of this? For someone like me who isn't yet an advanced Javascript user, I feel this could be a terrific, concise learning opportunity, and while I understand more or less what is going on, I have next to no idea as to the why.
[ Parent
| on HN ]
Re:The world's smallest and fastest classical JavaScript inh...
by jashkenas on Saturday February 15, 2014 @02:00PM
(#7244840)
You're in luck. I boiled it down from the slightly more comprehensive version that Backbone uses, annotated here:
http://backbonejs.org/docs/backbone.html#section-206
The main difference being that the Backbone version is also copying "static" properties -- properties defined directly on the parent constructor function -- down into the subclass.