Shortcut if statement

hi everyone… i was wondering, is there a shortcut to a script such as…

if(myVariable == 2 || myVariable == 4 || myVariable == 10 || myVariable == 15 || myVariable == 17)
{
// do something
}

i was wondering if it was possible to just type:

if(myVariable == 2 || == 4 || == 10 || == 15 || == 17)
{
// do something
}

or…

if(myVariable == 2, 4, 10, 15, 17)
{
// do something
}

well, one thing i know is i could use an array and run through the array using a “for” loop… but just wondering out of trivial curiosity if it was possible this way…