_.isNaN

Checks if a value is NaN.

  1. // Underscore/Lodash
  2. console.log(_.isNaN(NaN))
  3. // output: true
  4.  
  5. // Native
  6. console.log(isNaN(NaN))
  7. // output: true
  8.  
  9. // ES6
  10. console.log(Number.isNaN(NaN))
  11. // output: true

MDN:

In comparison to the global isNaN() function, Number.isNaN() doesn't suffer the problem of forcefully converting the parameter to a number. This means it is now safe to pass values that would normally convert to NaN, but aren't actually the same value as NaN. This also means that only values of the type number, that are also NaN, return true. Number.isNaN()

Voice from the Lodash author:

Lodash's _.isNaN is equiv to ES6 Number.isNaN which is different than the global isNaN.—- jdalton

Browser Support for isNaN

ChromeEdgeFirefoxIEOperaSafari
1.0 ✔

Browser Support for Number.isNaN

ChromeEdgeFirefoxIEOperaSafari
25.0 ✔15.0 ✔9.0 ✔