Cleaner if statements

Is there a tidier way to write this?

if [content][eventType] == 11 or [content][eventType] == 13 or [content][eventType] == 20 or [content][eventType] == 21 or [content][eventType] == 23 or [content][eventType] == 26 {
  do some stuff
}

E.g. can we do something like this?

arrayOfPossibleThings = [11,13,20,21,23,26]
if [content][eventType] in arrayOfPossibleThings {
  do some stuff
}

You can do

if [content][eventType] in [11,13,20,21,23,26] {

Perfect, thanks!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.