Avoid `null` in JavaScript

Use undefined instead.

Why?

`null` bypasses default function value checkers AND it& #39;s typeof is an & #39;object& #39;.

This leads to weird stuff.

& #39;undefined& #39; will respect default values set and won& #39;t validate and an & #39;object& #39;
I prefer how `return null` reads in code but the edge cases....

(╯°□°)╯︵ ┻━┻
You can follow @DavidWells.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: