I'm looking for a comprehensive (or as close as possible) list of all the prototype-programming style javascript work done to date. Does anyone know of such a list somewhere, or have the knowledge to compile it somewhere and then reference it here?
1 Answer
The short answer is that a comprehensive list probably does not exist.
Here is a resource that compares class and prototyped based Javascript, which includes examples of the styles you asked for:
http://www.learn-javascript-tutorial.com/Prototype-Based-Inheritance.cfm
You might want to consider a broader question and the possibly flawed underpinnings of class-based design (particularly for JavaScript): Why make JavaScript class based?
Function.prototype
, which in turn inherits from theObject.prototype
. Are you using arrays,Array.prototype
inherits fromObject.prototype
, are you doing as simple as'string constant'.charCodeAt(0)
, you're creating a temporary instance ofString
, which inherits fromString.prototype
, which in turn inherits fromObject.prototype
. Same goes forwindow
anddocument
... everything is an object, everything is prototype-based