Created
May 31, 2019 09:14
-
-
Save meftunca/38b54b4cc67a7b8403145ac833e1d96f to your computer and use it in GitHub Desktop.
CamelCase
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 camelize = camelize(str) => { | |
return str.replace(/\W+(.)/g, (match, chr) => | |
{ | |
return chr.toUpperCase(); | |
}); | |
}; | |
console.log(camelize("javaScript-Exercises")); | |
console.log(camelize("JavaScript exercises")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment