Quantcast
Channel: freeCodeCamp Challenge Guide: Title Case a Sentence
Viewing all articles
Browse latest Browse all 50

freeCodeCamp Challenge Guide: Title Case a Sentence

$
0
0

How about this version?

function titleCase(str) {
  return str.toLowerCase().split(' ').map(a => a.charAt(0).toUpperCase() + a.substr(1)).join(' ');
}

Read full topic


Viewing all articles
Browse latest Browse all 50