I was trying to find NaN in array. And I've found this way to do it.
console.log([1, NaN, 3].findIndex(Number.isNaN)); //1
And then I've tried to do the same with indexOf. Why it's not working?
console.log([1, NaN, 3].indexOf(Number.isNaN)); //-1