Hello FCC coders!
I don’t know why, but FCC is not accepting this code. It works on CodeOpen. Is it the issue of FCC site?
function titleCase(str) {
var arr=str.toLowerCase().split(' ');
var arrNew='';
for(var i=0; i<arr.length; i++){
var arrI = arr[i].charAt(0).toUpperCase() + arr[i].slice(1);
arrNew+=arrI+' ';
}
return arrNew;
}
titleCase("I'm a little tea pot");