You could use a ternary for this
```js
val += isMin ? deltaLeft : deltaRight;
```