Title Case a Sentence - Why won't this work?

Hey everyone,

I’m not really sure why I can’t pass the Title Case a Sentence algorithm with the following code, it passes all of the tests in the console. Any thoughts?

var titleCase = function titleCase(str) {
  var splitSentence = str.toLowerCase().split(' ');
  var titleCasedArray = splitSentence.map(function (el) {
    return el.charAt(0).toUpperCase() + el.substring(1, el.length);
  });
  var result = titleCasedArray.join(' ');
  return result;
};

titleCase("I'm a little tea pot");

I tested your code and it passed fine. You may just need to refresh the page and run the test again. If that does not work, try closing the browser and coming back in to run the tests.

Yes! Thought so. Thanks Randell