Created
May 11, 2012 23:44
-
-
Save beakr/2663143 to your computer and use it in GitHub Desktop.
Coffeescript -- safe extension of native 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
Object.defineProperty String, 'capitalize', value: -> | |
this[0].toUpperCase() + this[1...] | |
console.log char for char of 'str' | |
# => 0, 1, 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment