But using loose comparison is not a good practise,
Tools like eslint can be configured to only allow loose equality when comparing with null
.
Are people checking document.all
often enough to worry about it?
There is also one other way (not very nice) way to do it with current syntax.
if ((a ?? undefined) !== undefined) {
...
}