A multiplication doesn't see necessary here. Maybe add a comment instead:

```
    // Right overhang is negative, so subtract to add absolute width
    availableWidth = menuWidth - rightOverhang; 
```

This does not seem to be a performance bottleneck, so using `Math.abs()` is more clear:

```
    // Right overhang is negative
    availableWidth = menuWidth + Math.abs(rightOverhang); 
```