Hi,
I am kind of stuck with this challenge.
I have this code that is giving me the following error : charAt is not a function
Code:
function titleCase(str) {
var strLowerCase = str.toLowerCase().split(" ");
var firstUpperCase = strLowerCase.map(function (firstUpper){
firstUpperCase = strLowerCase.replace(strLowerCase.charAt(0), strLowerCase.charAt(0).toUpperCase());
return firstUpperCase;
});
str = strLowerCase;
return str;
}
titleCase("I'm a little tea pot");
to be honest I don´t fully understand why I receive this error, and I think I misunderstood something from the charAt() or map() functions.
Could anyone please shed some light?
Thank you!!
G.