Gosh it's simple.
returns true if the needle variable is found in the haystack array.
Otherwise returns false.
function arraySearch(needle, haystack){ for (var x in haystack){ if (haystack[x]==needle) return true; } return false; }