Created
June 22, 2015 15:05
-
-
Save jbnv/cf70333972b30ec40418 to your computer and use it in GitHub Desktop.
camelize() function in JavaScript
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
camelize = function (str) { | |
return str.replace(/[\-_](\w)/g, function (match) { | |
return match.charAt(1).toUpperCase(); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment