# Writing better if statements

**URL:** https://forum.kirupa.com/t/writing-better-if-statements/305794
**Category:** Uncategorized
**Created:** [March 3, 2010, 4:17pm UTC](https://forum.kirupa.com/t/writing-better-if-statements/305794 "2010-03-03T16:17:45Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![g5604](https://avatars.discourse-cdn.com/v4/letter/g/54ee81/32.png) [@g5604](https://forum.kirupa.com/u/g5604)
#### Post date: [March 3, 2010, 4:17pm UTC](https://forum.kirupa.com/t/writing-better-if-statements/305794/1 "2010-03-03T16:17:45Z")

</div>

Hi,

I have the rather ugly, massive if statement. Is there any way I can compress it somehow?

if ((allSides.rotationY==-180) || (allSides.rotationY==0) || (allSides.rotationY==180) || (allSides.rotationX==-180) || (allSides.rotationX==0) || (allSides.rotationX==180)) {  
TweenMax.to(allSides, speed, {rotationY:endPosY,rotationX:endPosX,onUpdate:showHideSides});

sorry, not sure why I can uses the code tags.

thanks!  
g.
