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

@shafakyildiz wrote:

var i = 0;
function titleCase(str) {
var little = str.toLowerCase();
var words = str.split(" ");

while (i<words.length){
words.replace( words[i].charAt(0).toUpperCase(),words[i].charAt(0));
i++;

}
var joined=words.join();
return joined;
}

titleCase(“I’m a little tea pot”);

Why is my code wrong?

Read full topic


Viewing all articles
Browse latest Browse all 50