Redefining an Existing Method
|
|
Function.prototype.toString = function () { return "Function code hidden"; }; function sayHi() { alert("hi"); }
alert(sayHi.toString());
Function.prototype.originalToString = Function.prototype.toString;
Function.prototype.toString = function () { if (this.originalToString().length > 100) { return "too long."; } else { return this.originalToString(); } };
|
|
|
HTML code for linking to this page:
Related in same category :
-
-
-
-
-
-
-
-
-
|