Skip to content

Instantly share code, notes, and snippets.

@mattbontrager
Created December 14, 2015 21:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattbontrager/fe1624e88928ba48e41d to your computer and use it in GitHub Desktop.
Save mattbontrager/fe1624e88928ba48e41d to your computer and use it in GitHub Desktop.
convert hyphenated or underscored strings to camelCase
function camelCase(method) {
return method.replace(/[-_\s]+(.)?/g, function(match, c) {
return c ? c.toUpperCase() : "";
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment