I have an Array of Objects in Javascript:
function focal( name, data )
{
this.name = name;
this.data = data;
}
count = 0;
arrayFocal = [];
arrayFocal[count] = new focal( "Name", "12/08/2014" );
count++;
Now I want to find into arrayFocal by name
NOTE: IE 8
You can use filter
arrayFocal.filter(function(obj){
return obj.name=='Name';
});
It will return an array of objects which name matched. If you want just first one you can [0] for that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With