Let’s play this with the argument 3:
When called, a for loop starts at 1 and finishes at 3.
isEven is initialized as
i===1 in the first iteration, the variable is turned to its opposite – false. That’s what you can do with booleans:
!true === false
!false === true
When i is 2, isEven is true and when i is 3, isEven is false. And that’s what’s returned.
Thanks! Made it clear!