I have an array containing two objects:
let xyz = [
{amount: 1000, rate: 4},
{amount: 100, rate: 2},
{amount: 700, rate: 1}
];
The task is to multiply amount * rate
and update the values in the amount
key.
Desired output:
let result = [
{amount: 4000, rate: 4},
{amount: 200, rate: 2},
{amount: 700, rate: 1}
];