Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
capitalize(str=''){
return str.trim().split('')
.map((char,i) => i === 0 ? char.toUpperCase() : char )
.reduce((final,char)=> final += char, '' )
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment