Created
March 4, 2012 19:11
-
-
Save allenwb/1974400 to your computer and use it in GitHub Desktop.
A hypothetical Number mirror factory that distingishes between number values and number objects
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Number.prototype.introspect = function() { | |
"use strict"; //.See ES5.1 10.4.3 steps 1-3 | |
if (typeof this == "object") return Object.prototype.introspect.call(this);//generic object mirror | |
return new Float(+this); //Number value mirror | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment