Created
November 8, 2016 18:43
-
-
Save osiyuk/a4b8fa0fc72c283adfb99920acb6f646 to your computer and use it in GitHub Desktop.
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
// https://gist.github.com/osiyuk/d18ec38ceae0e12f7a6ed7be9077b6f7 | |
// prototype forwarding | |
// ...or monkey patching | |
String.prototype.capitalize = function() { | |
return this.charAt(0).toUpperCase() + this.slice(1).toLowerCase(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this is a simple method to convert and able to pass value to get desire output.
Outputs