https://jsfiddle.net/dy6vhnsc/
expected like this
myData: [{
id: 1,
name: 'Russell',
country: 'Windes',
amount: 7,
myaddedResult: [
{
id: 3,
name: 'Watson',
country: 'Australia',
amount: 9,
sumOfAmount: 16
},
{
id: 4,
name: 'Marcus',
country: 'England',
amount: 10,
sumOfAmount: 17
}
]
},
{
id: 2,
name: 'Smith',
country: 'USA',
amount: 8
}
],
ownerData: [{
id: 3,
name: 'Watson',
country: 'Australia',
amount: 9
},
{
id: 4,
name: 'Marcus',
country: 'England',
amount: 10
}
]
how to add new field and add sum of amount into the new array in javascript what would be best option please guide
Thanks