Skip to content

Instantly share code, notes, and snippets.

@MatthewVita
Last active August 29, 2015 14:07
Show Gist options
  • Save MatthewVita/b0bbd13d2b539e6efb3c to your computer and use it in GitHub Desktop.
Save MatthewVita/b0bbd13d2b539e6efb3c to your computer and use it in GitHub Desktop.
Empty.js - Convenience function, checks for "empty" values
//@desc: Convenience function that
//checks for "empty" values
//@use: console.log(Empty('hello!')); //false
function Empty(val) {
return (typeof(val) === 'undefined' || typeof(val) === 'null' || val === '' || typeof(val) === 'NaN' || val === false);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment