Created
May 7, 2015 21:19
-
-
Save Xophmeister/df3acce05bd024036ad1 to your computer and use it in GitHub Desktop.
Disjunction, functional style
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
var or = function(/* args */) { | |
if (arguments.length) { | |
var x = !!arguments[0], | |
xs = Array.prototype.slice.call(arguments, 1); | |
return x || or.apply(undefined, xs); | |
} else { | |
return false; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment