console.log(allStatuses);
This variable shows two arrays:
[true, false, false, false, false]
[true, false, false, true, false]
In some cases, additional arrays will be displayed with true/false
values.
I am interested in determining whether all the arrays shown contain only false
values. If they do, I want to execute a specific action.
Can anyone suggest the most efficient method to achieve this?
The following code snippet is being used for this functionality:
angular.forEach($scope.prefAccount, function(account){
if (typeof account === 'object') {
var allStatuses = [];
angular.forEach(account, function(alertStatus){
return allStatuses.push(alertStatus.enabled);
})
console.log(allStatuses);
}
});