_.isUndefined

Checks if value is undefined.

  1. // Underscore/Lodash
  2. console.log(_.isUndefined(a))
  3. // output: true
  4.  
  5. // Native
  6. console.log(typeof a === 'undefined');
  7. // output: true
  8. console.log(a === undefined);
  9. // output: true

Browser Support

ChromeEdgeFirefoxIEOperaSafari
1 ✔