Title Case a Sentence: Tests aren't passing for some reason

Tell us what’s happening:

I have passed in through the tests and it passed but it doesn’t say it passed. Am I missing something?

Your code so far

function titleCase(str) {
  var oldArray = str.toLowerCase().split(' ');
  var newString = '';
  for (var i = 0; i < oldArray.length; i++) { 
    var newArray = oldArray[i].split('');
    var firstChar = newArray.shift().toUpperCase();
    var oldString = firstChar + newArray.join('');
    newString = newString + oldString + ' ';
  }

  return newString;
}

titleCase("HERE IS MY HANDLE HERE IS MY SPOUT");

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36.

Link to the challenge:
https://www.freecodecamp.org/challenges/title-case-a-sentence

You have an extra space character at the end of the string you return in every test case which is caused by the following line:

newString = newString + oldString + ' ';

FYI the above is typically written using the += operator as follows:

newString += oldString + ' ';

See previous FCC challenge below for more info.

https://www.freecodecamp.org/challenges/concatenating-strings-with-the-plus-equals-operator

Thank you so much! I can’t believe it was right in front of me. This took me like the entire day. Thanks for the help.