Recently saw an article written to the flexible JavaScript, is very exclamation of the power of JavaScript.
<script language= "JavaScript" > Number.prototype.add=function (x) {return this+x; }; Number.prototype.subtract=function (x) {return this-x; } ; Number.prototype.getrangearray=function () {var arr=[]; for (var i=0;i<=this;i++) {Arr.push (i);} return arr; }; Number.prototype= Object.defineproperty (Number.prototype, "double", {get:function () {return (this+this);}}); Number.prototype= Object.defineproperty (Number.prototype, "Square", {get:function () {return (this*this);}}); 5+2 Alert (5..add (2)); Alert (5[' Add '] (2)); Alert ((5). Add (2)); 5+2-3 Alert (5..add (2). Subtract (3)); Alert (5[' Add '] (2) [' Subtract '] (3)); Alert ((5). Add (2) [' Subtract '] (3)); Alert (5..add (2) [' Subtract '] (3)); Array 0-5 alert ((5). Getrangearray ()); Alert (5..getRangeArray ()); Alert (5[' Getrangearray '); The alert ((5). Double); alert (5..double); Alert (5[' double ']); X*x Alert ((5). Square); alert (5..square); Alert (5[' square '); (5+5) * (5+5) ALert ((5). Double.square); alert (5..double.square); Alert (5[' double ' [' Square ']); Alert (5[' Double '].square);</script>
A versatile JavaScript