# Shortcut if statement

**URL:** <https://forum.kirupa.com/t/shortcut-if-statement/295553>\
**Category:** Uncategorized\
**Created:** [September 1, 2009, 8:37am UTC](https://forum.kirupa.com/t/shortcut-if-statement/295553 "2009-09-01T08:37:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ThreeDollarBill](https://avatars.discourse-cdn.com/v4/letter/t/7ea924/32.png) [@ThreeDollarBill](https://forum.kirupa.com/u/ThreeDollarBill)\
**Post date:** [September 1, 2009, 8:37am UTC](https://forum.kirupa.com/t/shortcut-if-statement/295553/1 "2009-09-01T08:37:59Z")

</div>

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

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

```

i was wondering if it was possible to just type:

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

```

or…

```auto
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…
