Last active
December 15, 2015 06:49
-
-
Save davidlonjon/5219253 to your computer and use it in GitHub Desktop.
JavaScript: Check list of arguments if null or undefined
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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