I have an array within an angular scope that basically contains an object within each iteration. I have used the indexOf() 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?
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?
rules = [];
rules[0] = { word:"house"}
rules[1] = { word:"shoes"}
rules[2] = { word:"tools"}