Simplify `undefined` and `null` detection

Instead of using `typeof x !== "undefined" && x !== null`,
use a simpler `x != null` instead.