For the purpose of example lets have the following object:
var myobj = {id: 1, text: 'hello world', user_id: 5}
Now lets say we have an array:
var objectContainer = []
And we fill this objectContainer with x number of myobj
Now we wish to find the myobj
that has the id
value set to 30
You could use a loop but in worst case you would have to loop through the whole array before finding your value.
So my question is does JaVaScript
have a function for these situations or does AngularJs
provide additional helpers to solve this?