No it’s not. When num & 1 is successful you end up with only 1 as the resulting value, which is truthy value.
If you were instead checking for even numbers you would end up with 0, and would need to check that the resulting value equals zero for the desired outcome (that being even values) to be true.
Let say for example: 23 & 1 = 1 + 0(last digits of 8 bits binary) = 0 → This will return 0 and this is getting filtered in the final filtered array.
Based on some explanation here.
Now I am clear. May be I get some wrong interpretation(I had reached at reciprocal conclusion), but it’s clear now. Binary for even ends in 0 and for odd 1. Thanks for the discussion. so in case of odd:
1+1 = 1, and return will be a true.