I have an array of sorted ints with a 1,000 or more values (could be up to 5000+). I need to write a function that receives an int and returns a bool based on the element be
If doing lookups more than once, migrate to a map-like object.
var fastLookup = {}; mySortedArray.forEach(function(i){fastLookup[i]=true)}); //Each time: if (fastLookup[key]===true){ //do thing }