Created
March 10, 2021 08:31
-
-
Save kuznetsovandrey76/b4bbc624d62c35ba17e8e9b5a9184568 to your computer and use it in GitHub Desktop.
CAPITAL to 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
let str = "TIRE AND WHEEL AGREEMENT SECTION"; | |
let res = ''; | |
str | |
.toLowerCase() | |
.split(' ') | |
.forEach((el, i) => { | |
if (i) { | |
el = el.charAt(0).toUpperCase() + el.slice(1); | |
} | |
res += el; | |
}) | |
console.log(res) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment