**Tell us what’s happening:**

I came up with this solution to the challenge, but was curious about the answers given in the ‘Get a hint’ section, and to my chagrin saw that this wasn’t one of the given solutions. What I would like to know is, are the solutions given in the hints section better than mine? Though it passed the tests, is this (my solution) not a ‘good’ solution, or is it a ‘worse’ solution?

Also I noticed the recursive solution (in the hint section), recursion is still a little over my head, but is that a better solution since it’s more advanced? I know I’m asking a lot of questions here, with possibly subjective answers, but I’m very curious. Thank you.

**Your code so far**

```
function findLongestWordLength(str) {
const longestWord = str.split(' ').map((x) => x.length).sort((a,b) => b-a);
return longestWord[0];
}
findLongestWordLength("The quick brown fox jumped over the lazy dog");
```

**Your browser information:**

User Agent is: `Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36`

.

**Link to the challenge:**

https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-algorithm-scripting/find-the-longest-word-in-a-string