Skip to content

Instantly share code, notes, and snippets.

@radamant
Created January 10, 2010 21:15
Show Gist options
  • Select an option

  • Save radamant/273773 to your computer and use it in GitHub Desktop.

Select an option

Save radamant/273773 to your computer and use it in GitHub Desktop.
Function.prototype.method = function (name, func) {
this.prototype[ name] = func;
return this;
};
Number.method('integer', function(){
return Math[this < 0 ? 'ceil' : 'floor'](this);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment