JavaScript Prototypes and Inheritance
December 20th, 2010
3 comments
Someone on Hacker News asked for a concise description of “prototype” in JavaScript. I gave it a go, but the topic closed before I could post. So I saved it here for posterity.
And then I blew it out and made it considerable less concise, which might or might not be for the best, but you can be the judge of that.
Prototype-based inheritance in JavaScript can be a little bit strange to people accustomed to class-based inheritance, but it really doesn’t need to be difficult to grok. Like so many things, once you “get it”, it seems easy enough.
Read more…