A String Object Prototype
/* JavaScript Bible, Fourth Edition by Danny Goodman John Wiley & Sons CopyRight 2001 */ <HTML> <HEAD> <TITLE>String Object Prototype</TITLE> <SCRIPT LANGUAGE="JavaScript1.1"> function makeItHot() { return "<FONT COLOR='red'>" + this.toString() + "</FONT>" } String.prototype.hot = makeItHot </SCRIPT> <BODY> <SCRIPT LANGUAGE="JavaScript1.1"> document.write("<H1>This site is on " + "FIRE".hot() + "!!</H1>") </SCRIPT> </BODY> </HTML>