By dansim
via javascriptkata.com
Published: May 23 2007 / 16:54
There are hundreds of ways to do inheritance in javascript but a single one is simpler, cleanier and prettier than all the other ones.
Comments
tbanes replied ago:
Javascript doesn't really have any classes, per se, and this method of "inheritence" does not correspond to classical inheritence.
See some of Douglas Crockford's stuff for more details.
madarco replied ago:
I think the best way to do OOP in Javascript is Haxe. Not only for the "class foo { ... }" syntax, but also for the type inference.
Honkin_Liar replied ago:
OO need not be class based, see: http://en.wikipedia.org/wiki/Prototype-based_programming
Voters For This Link (12)
Voters Against This Link (3)