In addition to @nhcarrigan’s answer above, there are better ways of solving this challenge like converting the string to an array of words and looping through instead of looping through an array of characters. And be careful with str[i+1].toUpperCase();. Besides .toUpperCase() returning a new string, you run a risk of calling it with undefined if the string provided ends with " " which will throw an error.