3 ms·
The language is uniquely poorly defined for this. Node got this almost right, by baking in a sort of Option type to callback signatures. The community ignored i
by eyelidlessness 6y ago
The language is uniquely poorly defined for this. Node got this almost right, by baking in a sort of Option type to callback signatures. The community ignored it and ignored failure conditions. It’s bonkers that there’s at least three (yes three, not two; empty array slots are neither null nor undefined, they just resolve to undefined if you access them like any missing property on an object) nullish types in the language but you can’t gloss over that by pretending they don’t exist.