I also have to ask: Suppose your incoming array looks like this:
Code:
[ "adamson = 123", "jones = 775", "adams = 999" ]
If you ask for "adams", you are going to find "admason" first. Is that really what you want?
Seems to me like this kind of array is a mistake. I think you would want an object with multiple properties, thus:
Code:
var userinfo = {
"adamson" : 123,
"jones" : 775,
"adams" : 999
};
And now you could just do
Code:
var value = userinfo["adams"];
Much more efficient and you won't get "false positive" matches.