I need to get the values from the propertyTwo from an javascript object and sum at the end.
Using Object.values i see the structure below :
console.log(Object.values(myObj));
[0]
propertyOne
[0]
propertyTwo
:
"123456.25"
[1]
propertyOne
[0]
propertyTwo
:
"78910.35"
I try to run this loop :
Object.keys(myObj).forEach(key => {
const value = myObj[key];
console.log(`Key: ${key}, Value: ${value}`);
});
But the result end with the Object keyword, how can i get access and sum each value from propertyTwo ?
Key: 0, Value: [object Object]