Home | Mailing List | Blog | Tutorial Videos

Identity Crisis

Consider the following comparison function and its applications. What gets logged?

const compare = a => a === a;

console.log(compare(null));
console.log(compare(undefined));
console.log(compare(NaN));
console.log(compare([NaN]));

Select one: