Created
November 25, 2020 22:07
-
-
Save jasonvarga/08cce047bfbd1ce32e911d2e36bbadfd to your computer and use it in GitHub Desktop.
JS snake_case to PascalCase
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 snakeToPascal = str => str | |
.split('_') | |
.map(word => word[0].toUpperCase() + word.slice(1)) | |
.join(''); | |
snakeToPascal('hello_world'); // HelloWorld |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment