0

So, this code is about changing every word's first letter capital of the whole string..

eg, "My name is junaid choudhary" \\\ to //// "My Name Is Junaid Choudhary" But the code is not working, can anybody tell me what changes should i made to work it properly?? *** *** function titleCase(str) { words = str.split(" "); reqlist = []; for (var i in words){ reqlist[i] = words[i].toLowerCase().replaceAt(0, words[i].charAt(0).toUpperCase()); } return reqlist.join(" "); } titleCase("I'm a little tea pot");

23rd Sep 2017, 10:40 AM
Junaid Choudhary
Junaid Choudhary - avatar
2 odpowiedzi
+ 3
Javascript does not have replaceAt function. You need to define it. https://code.sololearn.com/W60MYC6ka4Hq/?ref=app
23rd Sep 2017, 10:40 AM
Calviղ
Calviղ - avatar
+ 1
Ok sorry.. i didnt saw the link of anser you have provided.. i gotcha.. Thank you!!
23rd Sep 2017, 10:46 AM
Junaid Choudhary
Junaid Choudhary - avatar