Search for a value within an object in javascript : <p>I have an array within an angular scope that basically contains an object within each iteration. I have used the <strong>indexOf()</strong> function before to check if a value exists within an array - but how can I check if a value exists within the object word value?</p>

<p>I want to use a foreach loop and just check if a word exists within the rules array in the format shown below - how is the best way to achieve this?</p>

<pre><code>rules = [];

rules[0] = { word:"house"}
rules[1] = { word:"shoes"}
rules[2] = { word:"tools"}
</code></pre>
