title: javascript set all values in array of object
body: <p>Two part question about similar problems. I've got 2 different arrays,</p>
  
  <p><strong>array 1:</strong></p>
  
  <pre><code> array1 = [{
       name : "users",
       checked : true
     }, {
       name : "active users",
       checked : false
     }, {
       name : "completions",
       checked : false
     }]
  </code></pre>
  
  <p>I would like to know if there is an easy way to set all the checked values to true at once. I know this is possible with a for loop:</p>
  
  <pre><code>  for (var i = 0 ; i &lt; array.length ; i++) {
      array[i].checked = false
    }
  </code></pre>
  
  <p>Even though this is not a lot of code i'm just curious if there is a way to do this without iterating over every object in the array. (not sure if this is even possible or whether this makes any difference whatsoever, so if please correct me if i am wrong about any of this). </p>
  
  <p><strong>array 2:</strong></p>
  
  <pre><code>array2 = [{
       value1 : false,
       value2 : true,
       value3 : false,
       value4 : false, 
       value5 : false,   
     }]
  </code></pre>
  
  <p>Is it possible to simply set all the values to true or false at once (again i can use a for loop, but would prefer not to)</p>
  
  <p>(i'm using angular and lodash, but haven't been able to find a 'lodash' or 'angular' solution, but any solution will do)</p>