Here's something simple to check if user is in moderator. But I want to check if user is not in moderator.
if err && user in moderators return
Intuitively it would be like this
if err && user isnt in moderators return
But obviously this doesn't work. What's the best way to do it?
isnt
is the opposite of is
, which is the triple equals sign. Just negate the in
:
if err and user not in moderators return
or, using postfix if:
return if err and user not in moderators
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With