Array.prototype.everyintermediateconst users = [{active: true}, {active: true}]
users.every(u => u.active) // β trueUse every() to confirm that a property holds true for all objects in an array.
every() works on any array, including arrays of objects. You can check that all objects satisfy a structural requirement.
Challenge: Implement allHaveName(objs) that returns true if every object in the array has a .name property that is a non-empty string.
allHaveName([{name:'Alice'},{name:'Bob'}]) // β true
allHaveName([{name:'Alice'},{age:30}]) // β false