Another way to write it is with contains, e.g.
if (!['a', 'b', 'c'].contains('b'))
It saves the extra level of parentheses at the cost of replacing the operator with a method call.
Another way to write it is with contains, e.g.
if (!['a', 'b', 'c'].contains('b'))
It saves the extra level of parentheses at the cost of replacing the operator with a method call.