Do you know what will be the output of this code?
JavaScript
console.log([NaN].indexOf(NaN), [NaN].includes(NaN));
Show answer and explanation
The answer is -1 true.
indexOf compares with ===, and NaN is never strictly equal to itself. includes uses the SameValueZero algorithm, which does match NaN.