Check out example codes for "add key value pair to all objects in array". It will help you in understanding the concepts better.

Code Example 1

var arrOfObj = [{
  name: 'eve'
}, {
  name: 'john'
}, {
  name: 'jane'
}];

var result = arrOfObj.map(function(el) {
  var o = Object.assign({}, el);
  o.isActive = true;
  return o;
})

console.log(arrOfObj);
console.log(result);

Learn ReactJs, React Native from akashmittal.com