title: Add key value pair to all objects in array
body: <p>I wanted to add a key:value parameter to all the objects in an array.</p>
  
  <p>eg: </p>
  
  <pre><code>var arrOfObj = [{name: 'eve'},{name:'john'},{name:'jane'}];
  </code></pre>
  
  <p>Now I wanted to add a new parameter, isActive to all the objects so the resulting array will look like.</p>
  
  <p>eg: </p>
  
  <pre><code>    [{
      name: 'eve',
      isActive: true
  }, {
      name: 'john',
      isActive: true
  }, {
      name: 'jane',
      isActive: true
  }]
  </code></pre>
  
  <p>I can always loop through the array and insert a key,value pair. But was wondering if there was a better way to do so</p>