Yup, I figured the doubly nested ternary operator was a little messy. 
The rewrite doesn't quite work because of || precedence; this will work.
```
if (number > 8 || number < -8)
  number = number % 7 || (number > 0 ? 7 : -7)
```