132
rated 0 times
[
138]
[
6]
/ answers: 1 / hits: 18325
/ 8 Years ago, fri, january 29, 2016, 12:00:00
I've defined an object
var Person = function(name,age,group){
this.name = name,
this.age = age,
this.group = group
}
var ArrPerson = [];
ArrPerson.push(new Person(john,12,M1));
ArrPerson.push(new Person(sam,2,M0));
Now I need an efficient mechanism to identify if the array of objects ArrPerson contains a particular name or not?
I know we can iterate over the array using for loop and check.Assuming the array is huge,is there any other efficient way of doing this?
More From » arrays