Skip to content

Instantly share code, notes, and snippets.

@davidlonjon
Last active December 15, 2015 06:49
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 davidlonjon/5219253 to your computer and use it in GitHub Desktop.
Save davidlonjon/5219253 to your computer and use it in GitHub Desktop.
JavaScript: Check list of arguments if null or undefined
// Inspired from http://stackoverflow.com/questions/2900333/javascript-how-to-compare-multiple-variables-value
is_null_or_undef = function(args) {
for (var i =0; i < arguments.length; i++) {
if (arguments[i] == null || typeof arguments[i] === 'undefined') {
return true;
}
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment