I have an array of this format:
array [ object{key1: v1, key2: v2}, object{key1: v3, key2: v4} ]
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
for(var i=0;i<array.length;i++){
array[i][key1] = v2;
}
is there a faster way of doing this? for example is it possible to pass an array instead of i like so
i= [0,1];
array[i][key1] = v2;