Last active
November 3, 2016 14:18
-
-
Save matijs/8b319bc9c7281ba3fa421a97f2edf525 to your computer and use it in GitHub Desktop.
Convert foo-bar-baz into a camelCased version
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
const camelCase = str => str.split( /[_,-]+/ ).map( ( item, index ) => index === 0 ? item : item.charAt(0).toUpperCase() + item.slice(1).toLowerCase() | |
).join(''); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment