https://gitlab.synchro.net/main/sbbs/-/commit/87dceb286ef8215ca6d2efa122e21d33f505b92b#note_1411
Many truthy things can be non-objects, so testing for
thruthiness isn't> useful. > The test is there specifically
to find things that can be passed to Object.keys()> without
an exception.
The else case is an implied return... expanding to something
like:
```
if (typeof obj !== 'object')
return
if (obj === null)
return
```
would be needlessly verbose.
I generally prefer a single return as a pattern except in cases
where indentation gets too deep or when goto would be required.
Hunting for returns when debugging is a PITA.
Object.keys(true)[]
Object.keys(1)[]
Object.keys(new Date())[]
Object.keys(false)[]
Object.keys([])[]
| Sysop: | Gate Keeper |
|---|---|
| Location: | Shelby, NC |
| Users: | 820 |
| Nodes: | 20 (0 / 20) |
| Uptime: | 181:19:06 |
| Calls: | 13,718 |
| Calls today: | 5 |
| Files: | 5,294 |
| D/L today: |
3 files (104K bytes) |
| Messages: | 621,943 |