How to find index of an object by key and value in an javascript array
<p><strong>Given:</strong></p>

<pre><code>var peoples = [
  { "attr1": "bob", "attr2": "pizza" },
  { "attr1": "john", "attr2": "sushi" },
  { "attr1": "larry", "attr2": "hummus" }
];
</code></pre>

<p><strong>Wanted:</strong></p>

<p>Index of object where <code>attr === value</code> for example <code>attr1 ===  "john"</code> or <code>attr2 === "hummus"</code></p>

<p><strong>Update:</strong>
Please, read my question carefully, i do not want to find the object via $.inArray nor i want to get the value of a specific object attribute. Please consider this for your answers. Thanks! </p>
