The output is as needed..still i cannot pass the test

Tell us what’s happening:

Your code so far

function titleCase(str) {
  var arr=[];
  var s="";
  var j=[];
  arr=str.split(" ");
  for(var i=0;i<arr.length;i++)
     var x= arr[i].charAt(0);
     x= x.toUpperCase();
     s=s+arr[i]+" "; 
  var s1='"'+s+'"'+".";
 return s1;
function setcharAt(string,index,char)
     return string;
      return string.substr(0,index)+char+string.substr(index+1);

titleCase("I'm a little tea pot");

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36.

Link to the challenge:

Not sure what you are trying to do with this code:

var s1='"'+s+'" '+".";

You don’t have to add quotes and a period. The quotes in the tests only indicate that the result should be a string.

:sweat_smile:thanx for the help…it did work!!!