title: Get the number of true/false values in an array using javascript
body: <p>I'm having an Array with properties <code>id</code> and <code>value</code></p>
  
  <pre><code> var arrayObj=  [
          {"id": 1, "value": true},
          {"id": 2, "value": false},
          {"id": 3, "value": true}
      ]
  </code></pre>
  
  <p>I need to get the number of objects that has the property <code>true</code>/<code>false</code>.
  I'm using <code>Array.prototype.every()</code> but my logic is not working as intended as it seems. Can anyone tell me what I'm doing wrong here? I'm not displaying the count</p>
  
  <pre><code>function checkIfFalse(value, index, ar) {
       document.write(value + " ");
       if (value  === false)
           return true;
       else
          return false;
  }
  
  if (arrayObj.every(checkIfFalse)) {
      console.log("all are false");
  }else {
      console.log("all are true");
  }
  </code></pre>