Hey fellow Campers. I’m working on the Title Case Algorithm Challenge. Well, more accurately, I peeked at the solution out of frustration, and now I’m just trying to understand why mine didn’t work.
function titleCase(str) {
var words = str.toLowerCase().split(" ");
for(var i=0; i<words.length; i++){
words[i][0].toUpperCase();
words.join(" ");
}
return words;
}
titleCase("I'm a little tea pot");
Any feedback on why this doesn’t pass muster?