It's unfortunate that ?.
is sugar for x !== undefined
and not typeof x !== 'undefined'
. The subtle difference is that the first one will fail if x
is not defined at all.
Would it make sense to disallow the operator unless the variable is in the scope?
iDontExist?.meNeither
globalThis.iDontExist?.meNeither
let iDontExist;
iDontExist?.meNeither
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too