'JS compare objects and NaN [duplicate]

Here's a function which checks whether input is a NaN:

function myIsNaN(value) {
  return value !== value;
}

myIsNaN({}) --> outputs false.

Why false if: {} !== {} --> true ???

myIsNaN([]) --> outputs false.

Why false if: [] !== [] --> true ???



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source