My steps go through and put the string into an array, then I loop to find spaces and uppercase the letter at the following index, then after that if statement is done I want to push all the chars that aren't spaces to a new array and join but my capitalized letters aren't showing in the final array.
var camelCase = function(str) {
console.log(str)
let upCased;
let finalStr = [];
let camelCase = str.toLowerCase().split("");
for (let i = 0; i < camelCase.length; i++) {
if (camelCase[i] == ' ') {
letter = camelCase[i + 1]
upCased = letter.toUpperCase();
console.log(upCased)
}
if (camelCase[i] !== ' ') {
finalStr.push(camelCase[i])
}
}
console.log(finalStr.join(""))
};
camelCase("now is the time to come to the aid")