3 ms·
In your nullable array example, you could just use optional chaining. There’s no need for lodash. I personally feel this type of ultra-defensive programming wh
by shortcake27 4y ago
In your nullable array example, you could just use optional chaining. There’s no need for lodash.
I personally feel this type of ultra-defensive programming where all types are assumed bad only harms you long run, adding complexity where it isn’t necessary to solve problems that don’t exist, and swallowing errors making it harder to debug. Exceptions exist for a reason.
When I switched to TS it was a great incentive to ditch lodash because it was munging all my types. This in turn simplified my code as it made me aware of unnecessary guards, coercions, and errors that lodash was swallowing.