If equality check null and undefined with == then the result will be true
console.log(null == undefined) //true
console.log(null === undefined) //false`
I have done a check like
const nullValue = null
let undefinedValue;
if (nullValue == undefinedValue) {
console.log('this will run')
}
if (nullValue === undefinedValue) {
console.log('this wont run')
}
New contributor
Ansam Chemban Davis is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1