I have an array set like tempArray[i] = {Name: 'foo', Data: 'bar'}
How would you use indexOf
to search through tempArray
looking to see if the name element was present?
I.e
if(tempArray.indexOf('foo') > -1)
{
//do stuff
}
Ive tried this way but it never seems to be true because I think 'foo' is not accessible due to it being reference by the .Name