```
status[(window.navigator.onLine ? 'online' : 'offline')](); 
```

would be more readable maybe :)