Created
May 9, 2011 16:58
-
-
Save michealbenedict/962876 to your computer and use it in GitHub Desktop.
This file contains 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.method('integer', function ( ) { | |
return Math[this < 0 ? 'ceil' : 'floor'](this); | |
}); | |
String.method('trim', function ( ) { | |
return this.replace(/^\s+|\s+$/g, ''); | |
}); | |
Function.prototype.method = function (name, func) { | |
this.prototype[name] = func; | |
return this; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment