I don't think the `()` are needed here and `is` is preferred over `==` so this line could just be:

```coffee
if typeof commandOrSubmenu is 'object'
```