Need help understanding where Im wrong. Also, would love to see other solutions.
Show me another way to set this code up! Thank yall
**Your code so far**
function findLongestWordLength(str) {
const array = str.split('')
const wordLengths = array.map((word) => {
return word.length
})
return Math.max(...wordLengths)
}
findLongestWordLength("The quick brown fox jumped over the lazy dog");
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36
Challenge: Basic Algorithm Scripting - Find the Longest Word in a String
Link to the challenge: