I have an array that looks like this simplified:
[{one: false,two: 'cat'},{one: true, two: 'dog'},{one: false, two: 'ball'}]
I want to check if any of the one, values are true. The solution I can think of is something like
var truthness;
array.forEach(function (element, i, array) {
if(element.one){
truthness = true
break;
}
}
if(truthness){
//code
}else{
//other code
}
is there a better way to do this?