Skip to content

Instantly share code, notes, and snippets.

@VinnyFonseca
Last active September 28, 2021 21:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VinnyFonseca/5748697 to your computer and use it in GitHub Desktop.
Save VinnyFonseca/5748697 to your computer and use it in GitHub Desktop.
Empty Object Check
function isEmpty(obj) {
return (
(typeof obj == 'undefined' || obj === null || obj === '')
|| (typeof obj == 'number' && isNaN(obj))
|| (obj instanceof Date && isNaN(Number(obj)))
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment