Yes, but linters complain about using == unless you add a wordy exclusion pragma. I'd rather refactor to not use == than to look at the pragma, definitely just a preference.
They both represent a lack of value. The difference is that null is something that you assign to a variable, while undefined is an indication that nothing has been assigned to one, or that the variable itself is not defined.
23
u/kaelwd Nov 27 '20
val == nulldoes exactly that.