Skip to content

Instantly share code, notes, and snippets.

@YaroslavW
Created March 1, 2019 16:03
Show Gist options
  • Save YaroslavW/1a247cdb669aaf17c46493a28d767d02 to your computer and use it in GitHub Desktop.
Save YaroslavW/1a247cdb669aaf17c46493a28d767d02 to your computer and use it in GitHub Desktop.
null and undefined checking
// ===> For Null
const isNull = (val) => !val && typeof val === 'object';
isNull(null); // true
// ===> For undifined
const isUndefined = (value) => typeof value === 'undefined';
isUndefined(undefined); // true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment