This still looks more complicated than it possibly should. I suggest changing this to 

```js
// Add a linebreak if needed
return (layer.displayInLayerSwitcher && !layer.isBaseLayer);
```

Change this if you agree (and if it doesn't change semantics :wink:), this is only a minor comment.