Iterators .findIndex() - true or false?

I have a question about .findIndex()
exercise link: https://www.codecademy.com/paths/front-end-engineer-career-path/tracks/fecp-javascript-syntax-part-ii/modules/fecp-learn-javascript-syntax-iterators/lessons/javascript-iterators/exercises/find-index

Find the first word in the array that starts with the Letter “s”
My code looks like this and the Codecademy auto-check approved my solution

const animals = ['hippo', 'tiger', 'lion', 'seal', 'cheetah', 'monkey', 'salamander', 'elephant'];

const startsWithS = animals.findIndex(animal => {
  return animal.charAt(0) === "s";
});

I often look at the solution after I’m done and found the provided code looks like this:

const animals = ['hippo', 'tiger', 'lion', 'seal', 'cheetah', 'monkey', 'salamander', 'elephant'];


const startsWithS = animals.findIndex(animal => {
  return animal[0] === 's' ? true : false;
});

Why is there an additional check for true or false? Imho my code would not return an index if index[0] is not “s”, so why is this included here?

What am I missing or not understanding?
Is it necessary to check true/false? Why/why not?

These are just two different ways of doing essentially the same thing. As Codecademy courses tend to be for beginners, their solutions are usually aimed towards the most basic/expected way to do things, however in programming there’s often multiple solutions to the same problem. Your code makes used of the .charAt() string method, whereas the Codecademy solution uses a ternary operator to return true if the animal begins with the character s. It’s simply another way of solving the problem.

That makes sense, thank you!