Javascript prototypes?


Prototypes can extend any class you want by adding a property or a method. By calling,
[source:javascript]
String.prototype.alertMe = function() {
alert(this);
}
[/source]
you are adding the method alertMe() to every String object of your application.
It uses less memory because javascript creates only one instance of the function and uses references to it.

0 comments: