Simple Javascript Inheritance

There are lots of articles out there on the web explaining how to mimic the type of inheritance many of us programmers who come from Java or C# are accustomed to. Dean Edwards, Kevin Lindsay, and Douglas Crockford all come to mind. Each has done some very impressive work in with regards to Javascript inheritance.

Each of their approaches has its own advantages and disadvantages, and each approach is (at least in my mind) a little bit confusing. Heck, Douglass Crockford even talks about kinds of inheritance I've never even heard of!

I don't hesitate for a second to admit that each of these guys is probably a more skilled Javascripter than I am, but to be perfectly honest, well... I didn't completely understand their approaches. That doesn't mean they aren't good. On the contrary, it probably only serves to illustrate how much I still have to learn.

Regardless... I'm not completely comfortable using code I don't understand, so I took a crack at my own solution -- something really simple that I did understand. Perhaps my approach may not be as robust, but it's pretty darn simple to implement (and to use), and so far I've found it to be quite effective. So enough babbling... on to the technique.

Continue reading Simple Javascript Inheritance