Modifying Objects : prototype : Object Oriented JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Object Oriented » prototype »

 

Modifying Objects







You can define a new method for any existing class by using its prototype property.








Number.prototype.toHexString = function () {
    return this.toString(16);
};
var iNum = 15;
alert(iNum.toHexString());







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Object Oriented
» prototype