Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

eq to any in JavaScript

View gist:1012380
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
function eqToAny (el /*, args */) {
var args = [].slice.call(arguments, 1);
if (args.length == 0) return false;
for (var i = 0, l = args.length; i < l; i++) {
if (el === args[i]) {
return true;
}
}
return false;
}
 
var a = 1;
var b = 2;
var c = 3;
var d = 1;
 
console.log(eqToAny(a, b, c, d)); // true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.