Posted by: nyshangal October 10, 2011
javascript array
Login in to Rate this Post:     0       ?        
 I have an array, I have say suppose 10 key pairs in that arraay

array[0].val=ab
array[1].val=cd
array[2].val=ef
array[3].val=gh
.
.
.
.
array[8].val=wx
array[9].val= yz


now I have two values say suppose "ij" and "kl" , I want to check if this array contains that value "IJ" and "kl", if it does, i want to return 

"yz" in this case array with index 9,

for(var i =0; i <array.length;i++){
if(array[i].val=="ij" && array[i].val=="kl"){
//code goes here,,but what ? 
}
}


P.S i am using prototype
Read Full Discussion Thread for this article