I have a collection of Customer objects inside the JavaScript Array.
var customer = Customer();
customer.firstName = "John";
customer.isEnabled = true
var customer2 = Customer();
customer2.firstName = "Mary";
customer2.isEnabled = false
var customers = [customer,customer2];
Now, I want to return true if any of the objects inside the customers array property "isEnabled" = false. Basically I want a way to validate a property of every object that is inside the array (customers).
UPDATE:
So using the some function I can do something like this:
customers.some(e => e.isEnabled == true)
So, now it will only return true if all the elements in the array have isEnabled property to true. Is that right?