ID:159854
 
Is there a way to say "!in"?

I'm trying to say "if source is not in range". How would I do that?
if(!(x in y))


Note the parenthesis around "x in y". Without the parenthesis there, this would not work!

The reason it wouldn't work without the parenthesis is because ! has a higher operator order/standing then 'in', so:
if(!x in y)
= if((!x) in y)
= if((!(0 or 1)) in y)
= if((1 or 0) in y)
= Not working as intended


if(!(x in y))
= if(!(0 or 1))
= 1 or 0
= Working as intended
In response to GhostAnime
I see. Thanks!