Last active
August 29, 2015 14:06
-
-
Save krambuhl/a983d5a4853033081c04 to your computer and use it in GitHub Desktop.
gets first argument that is not undefined;
This file contains hidden or 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
function firstdef() { | |
var isDefined = function(arg) { return !_.isUndefined(arg); }; | |
return _.find(arguments, isDefined); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment