This is the object I have
const upToPaidCost = [ { 'Labour Cost': '54000' }, { 'Material Cost': '24900' } ];
let arr = [];
for (const [key, value] of Object.entries(...upToPaidCost)) {
arr.push({ key: key, value: value });
}
console.log(upToPaidCost)
console.log(arr);
Expected output :
[
{
key: "Labour Cost",
value: 54000
},
{
key: "Material Cost",
value: 24900
}
]
It shows only the first key value, the second is missing, what am I making wrong here?