Created
March 6, 2014 22:42
-
-
Save kentbrew/9401391 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
// http://stackoverflow.com/questions/10425287/convert-string-to-camelcase-with-regular-expression | |
// fetch me my camel, Jeeves | |
var toCamelCase function (str) { | |
return str.toLowerCase().replace(/-(.)/g, function(match, group1) { | |
return group1.toUpperCase(); | |
}); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ES2015: