Hmm, perhaps this is more obvious:
```js
if (inBounds ? endAction : endAction === 'cancel')
```