Function to get index from an array of objects having certain value of provided property
<p>My question is based on and similar to <a href="http://stackoverflow.com/q/7176908/148271">this one</a> but a little bit different because property name will be variable.</p>

<p>How do I create a function which will return me index of object having certain value of provided property? </p>

<pre><code>function indexOf(propertyName,lookingForValue,array){
 //......

 return index;
}
</code></pre>

<p>So, </p>

<pre><code>indexOf("token",123123,[
    {id_list:1, name:'Nick',token:'312312'},{id_list:2,name:'John',token:'123123'}
    ]);
</code></pre>

<p>should return 1.</p>

<p>The main problem I have is how do I check the property value when I have the property name as string with me?</p>
