Tell us what’s happening:
Your code so far
function titleCase(str) {
str = str.toLowerCase().split(" ");
for(var i = 0; i < str.length; i++)
{
str[i] = str[i].split("");
str[i][0] = str[i][0].toUpperCase();
str[i][str[i].length] = " ";
str[i] = str[i].join("");
}
str = str.join("");
console.log(str);
return str;
}
titleCase("I'm a little tea pot");
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/60.0.3112.113 Chrome/60.0.3112.113 Safari/537.36
.
Link to the challenge: