Created
September 14, 2018 14:48
-
-
Save miftahafina/ebe8657cc9dad428b97d008189f2d7d5 to your computer and use it in GitHub Desktop.
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 ucwords = (str) => { | |
return str.toLowerCase() | |
.split(' ') | |
.map((x) => x.slice(0, 1).toUpperCase() + x.slice(1, x.length)) | |
.join(' '); | |
} | |
let tes = ucwords("loReM iPsum DolOr SIt aMet"); | |
console.log(tes); // result: "Lorem Ipsum Dolor Sit Amet" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment