I have an array like
["JOAQUIN", "BERNARDINO", "MODOC","ALASKA","MADERA", "ANDERSON"]
where I'm populating them in a jQuery UI Autocomplete
. However the order of sorting seems to be weird.
For example:(But I have more no.of records) When I type "a" it returns
JOAQUIN
BERNARDINO
ALASKA
MADERA
ANDERSON
What I'm trying is to get (starting with)
ALASKA
ANDERSON
JSFiddle for my example
Is it possible? Can someone point me in a right direction.
Updates: