Title Case Algorithm Challenge

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?

Thanks for the reply.

So just so I’m clear on this, the “calling string” would be whatever comes before .toUpperCase()?
E.g. - callingString.toUpperCase()?

So, I have to assign the function call to a variable in order to make it so I can work with it? Am I understanding you correctly?