Here, in the video example it is just written “no%2”
So how is it specified that it should be 1 if even and 0 if odd because it just give remainder thre is no specific condition to check odd/even.
Had it been no%2==1 ? 0:1; It would have made sense because we are giving a condition .
Ternary operator example
Hey , no%2 will also result in 0 or 1 because a number can either be odd or even.