Created
January 24, 2021 08:51
-
-
Save theDreamer911/11d527ad72e967dc54cdaefe36695bdf to your computer and use it in GitHub Desktop.
This file contains hidden or 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
word = "hello world what is up?"; | |
function capitalize(words) { | |
let word = words.split(" "); | |
let capital = []; | |
for (i = 0; i < word.length; i++) { | |
capital.push(word[i].charAt(0).toUpperCase() + word[i].slice(1)); | |
} | |
return capital.join(" "); | |
} | |
console.log(capitalize(word)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment