Created
July 27, 2016 15:51
-
-
Save novwhisky/bde9678fd1151607a875706e8f7bb33e 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
var camelized = String(inputString).split(/\s+/).reduce(function(p, c, idx) { | |
return (idx > 0) ? p + c.charAt(0).toUpperCase() + c.slice(1): p + c.charAt(0).toLowerCase() + c.slice(1); | |
}, ''); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment