I have an array (1000 pieces) of brands, where I would like to provide a fast search. So when I start typing ie: "m" then I should get "mammut" and "millet". The array is sorted. So does anybody know a fast solution which doesn't need to loop through the whole array? Best in javascript. Thanks
var brands = new Array("arcterix", "mammut", "millet", "ortovox", ... )
function search(brands, substring){
// will return array of founded brands which begins on substring
}