Skip to content

Instantly share code, notes, and snippets.

@kara-ryli
Created February 24, 2010 01:52
Show Gist options
  • Select an option

  • Save kara-ryli/312977 to your computer and use it in GitHub Desktop.

Select an option

Save kara-ryli/312977 to your computer and use it in GitHub Desktop.
Number.protototype entry for wtfjs
(1) === 1; // true
Number.prototype.isOne = function () { return this === 1; }
(1).isOne(); // false!
Number.prototype.reallyIsOne = function () { return this - 1 === 0; }
(1).reallyIsOne(); // true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment