Let's say I have an array of objects, something like:
{'field1':value1, 'fiedl2':value2, 'field3':value3}
....
{'field1':value4, 'fiedl2':value6, 'field3':value1}
I want each object of the array to be changed, so
for(let item of items){
//update item so it does not contain the old values but new calculated ones, so
item.fieldA=item.field1+item.field2;
item.fieldB=item.field3
}
So in the end, my array should have objects like:
{'fieldA':valueA, 'fieldB':valueB}
I am using node and I am trying to see how I can simply update or replace each object with its updated version with new properties and values
item.value1, did you meanitem.field1? Where is your array of objects, I just see an object?