Hi @ambareenk321!
Welcome to the forum!
So, I would first look at the test cases provided for you.
Test cases:
titleCase("I'm a little tea pot")
should return I'm A Little Tea Pot
.
titleCase("sHoRt AnD sToUt")
should return Short And Stout
titleCase("HERE IS MY HANDLE HERE IS MY SPOUT")
should return Here Is My Handle Here Is My Spout
You should notice that the str could have a mixture of upper and lower case letters.
So it would be easier to work with if you converted everything to one casing.
Then you can go through each word and uppercase only the first letter of each word.
I would dig around mdn docs to find some helpful string methods to help solve this challenge.