const persons = [
{ name: 'John', age: 25 },
{ name: 'Jane', age: 30 },
{ name: 'Bob', age: 28 }
];
// 判断数组中所有对象的年龄是否都大于等于 18
const allAdults = persons.every(person => person.age >= 18);
console.log(allAdults); // 输出 true
const persons = [
{ name: 'John', age: 25 },
{ name: 'Jane', age: 30 },
{ name: 'Bob', age: 28 }
];
// 判断数组中所有对象的年龄是否都大于等于 18
const allAdults = persons.every(person => person.age >= 18);
console.log(allAdults); // 输出 true