Usage of return (project Ravenous)

Hi guys ! If you have already done the project Ravenous I got a question for you.

At step 40 we are asked to do the following thing:
image

But I already have a return statement in the same function at line 12:

So i thought that after a return statement, the execution of the function is stopped and the code that follows it will not be executed. So I don’t understand how It works here.

If you have an answer, thank you !!! :raised_hands: :smiley:

PS: Don’t mind the comments :grin:

It’s because .map() takes in a function. So it’s a function within a function.

1 Like