Similar Question:
Locate specific object by id within a JavaScript objects array
What is the best way to determine if a value exists in a given JavaScript array?
For instance:
var arr = [
{id: 1, color: 'blue'},
{id: 2, color: 'red'},
{id: 3, color: 'yellow'}
];
alert( positionOf('blue') ); // How do I find the index of blue??