Skip to content

result is correct but doesn't recognize it #7678

Closed
marshall20 opened this Issue · 1 comment

2 participants

@marshall20

Challenge Title Case a Sentence has an issue.
User Agent is: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36.
Please describe how to reproduce this issue, and include links to screenshots if possible.

My code:

function titleCase(str) {
  var array = str.split(' ');
  str="";
  for(var i =0; i < array.length;i++){
    var string= array[i].substring(1, array[i].length);
    str+= array[i][0].toUpperCase() +string.toLowerCase() +" ";
  }
  return str;
}

titleCase("HERE IS MY HANDLE HERE IS MY SPOUT");
@raisedadead
Free Code Camp member

You are almost there @marshall20 !
Check your code, and use some logs there is an extra space in your output!

If you are stuck please visit our dedicated Chat Room for JavaScript/Algorithms

Thanks and Happy Coding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.