var array = [{ name: 'paul', age:20 }, { name: 'john', age:30 }, { name: 'albert', age:40 }],
find = function(array, name) {
return array.some(function(object) {
return object.name === name;
});
};
console.log(find(array, 'paul')); // true
console.log(find(array, 'maria')); // false
Run code snippet