This is a little function I found somewhere on the web:
function oc(a) {
var o = {};
for (var i = 0; i < a.length; i++) {
o[a[i]] = '';
}
return o;
}
Used like this:
if (x in oc(1, 3, 4, 17, 80)) {...}
I'm using it for strings myself; haven't tried with numbers, but I guess it would work.