Created
March 24, 2018 18:07
-
-
Save dragonza/af5c5e2a35a15e9610c7695510166d32 to your computer and use it in GitHub Desktop.
Sentence Capitalization
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
function capitalize(str) { | |
const arr = str.split(' '); | |
return arr.map(word => { | |
return word[0].toUpperCase() + word.slice(1); | |
}).join(' '); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment