A static type system can be used to make this type of error occur at compile-time rather than runtime. But, not everyone wants to make that tradeoff and some even like the semantics applied to that kind of expression. || often gets tasked with handling null/undefined in JS, e.g.
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments