I wanted to add a key:value parameter to all the objects in an array.
eg:
var arrOfObj = [{name: \'eve\'},{name:\'john\'},{name:\'jane\'}]; <
var arrOfObj = [{name: \'eve\'},{name:\'john\'},{name:\'jane\'}];
Looping through the array and inserting a key, value pair is about your best solution. You could use the 'map' function but it is just a matter of preference.
var arrOfObj = [{name: 'eve'},{name:'john'},{name:'jane'}]; arrOfObj.map(function (obj) { obj.isActive = true; });