Skip to content

Instantly share code, notes, and snippets.

@allenwb
Created March 4, 2012 19:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save allenwb/1974400 to your computer and use it in GitHub Desktop.
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
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