All of my results in the console are correct but I can’t ace the test.. my code is below
Your code so far
function titleCase (phrase) {
let normPhrase = phrase.toLowerCase()
let newPhrase = normPhrase.split(" ")
let result = ""
for (let firstChar of newPhrase){
result += firstChar[0].toUpperCase()
result += firstChar.slice(1)
result += " "
}
return result
}
console.log(titleCase("I'm a little tea pot"))
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:140.0) Gecko/20100101 Firefox/140.0
Challenge Information:
Build a Title Case Converter - Build a Title Case Converter
You did not run the line of code I gave you. Please run the line of code I gave you. I have a very good reason for writing that line. It will show you something important.
Exactly. That little trick of adding "***" (or something like that) makes it easier to spot those sort of ‘invisible’ issues with spaces on the end of the line.