Basic Algorithm Scripting - Title Case a Sentence

Tell us what’s happening:
Describe your issue in detail here.
I used console.log() command to verify my code, it can output the string that convert each first letter to uppercase, but it still not pass, anything wrong with my code?

Your code so far

function titleCase(str) {
  let arr=str.split(" ");
  let stry="";
  for(let i=0;i<arr.length;i++)
    stry+=arr[i]+" ";
  return stry;

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

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36

Challenge: Basic Algorithm Scripting - Title Case a Sentence

Link to the challenge:

Try this

console.log("****" + titleCase("I'm a little tea pot") + "****");
1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.