The "in" keyword checks the presence of keys, not values. The array has keys 0, 1, 2, 3. Basically "in" does not do the same thing as Python. l.includes(4) is true.

Reply to this note

Please Login to reply.

Discussion

ohhh, interesting, thank you so much for the explanation 💜

so that’s why a string is also a key and considered true in this scenario then? 🤔