Created
September 14, 2018 14:49
-
-
Save miftahafina/ca8260b64d0c8680f714ec9895eff6c6 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