Good afternoon everyone,
I had a hard time trying to figure out this challenge. I feel like I got this but I’m not getting the green light for being correct. Please advise on my code below. I don’t want to see what others have, I’d like to learn what the issue is.
Thanks in advance!
p.s. Ignore the basic nomenclature.
Title Case a Sentence
function titleCase(str) {
var lowerCase = str.toLowerCase();
var splitter = lowerCase.split(" ");
var total = “”;
var split2 = “”;
var reverso = “”; //Ignore
var joiner = “”;
for (var i = 0; i < splitter.length; i++) {
total = total + splitter[i].charAt(0).toUpperCase() + splitter[i].slice(1) + " “;
split2 = total.split(” “);
joiner = split2.join(” ");
} return joiner;
}
titleCase(“I’m a little tea pot”);