Possible Duplicate:
Find object by id in an array of JavaScript objects
How to check if value exists in this JavaScript array?
For example:
var arr = [
     {id: 1, color: 'blue'},
     {id: 2, color: 'red'},
     {id: 3, color: 'yellow'}
];
alert( indexOf('blue') ); // How can I get the index of blue??
 
     
     
     
     
     
     
    