title: Javascript array, modify values for all keys
body: <p>I have an array of this format:</p>
  
  <pre><code>array [ object{key1: v1, key2: v2}, object{key1: v3, key2: v4} ]
  </code></pre>
  
  <p>right now, to change the value of each object, where it is key is lets say, key1 to v2, I am looping over each object, like this</p>
  
  <pre><code>for(var i=0;i&lt;array.length;i++){
     array[i][key1] = v2;
  }
  </code></pre>
  
  <p>is there a faster way of doing this? for example is it possible to pass an array instead of i like so </p>
  
  <pre><code> i= [0,1];
   array[i][key1] = v2;
  </code></pre>