_.isNull

Checks if value is null or undefined.

  1. // Underscore/Lodash
  2. console.log(_.isNull(null))
  3. // output: true
  4. console.log(_.isNull(void 0))
  5. // output: false
  6.  
  7. // Native
  8. console.log(null === null);
  9. // output: true
  10. console.log(void 0 === null);
  11. // output: false

Browser Support

ChromeEdgeFirefoxIEOperaSafari