var lost = [4, 8, 15, 16, 23, 42]; function isLost(n) { return !!(lost.indexOf(n) + 1); } if(isLost(12)) alert('12 is a lost number'); if(isLost(16)) alert('16 is a lost number');