Please, please read http://killdream.github.com/blog/2011/10/understanding-javas...
Prototypical inheritance as of ES5 is really not that hard. Here is the same example rewritten with prototypes: https://gist.github.com/1558929
Prototypical inheritance as of ES5 is really not that hard. Here is the same example rewritten with prototypes: https://gist.github.com/1558929
https://gist.github.com/1559933
The original was 28 lines, this is 36 (mostly because I like white space).
I haven't ever really tried to emulate classes in JS, but this is probably how I would do it. The major difference is that this is written plain old Javascript rather than some special syntax - easier to understand.