Hi i am trying to find the sum of Boolean values in the object array in JavaScript
My json like be
var myoBj = [{ \"id\": 1, \"day\": 1, \"st
You could use Array.some with predicate a => !a.status or Array.every with predicate a => a.status.
Array.some
a => !a.status
Array.every
a => a.status
Either of them will short-circuit if you find a mismatch, while Array.reduce will not.
Array.reduce