I\'d like to sum the values of an object.
I\'m used to python where it would just be:
sample = { \'a\': 1 , \'b\': 2 , \'c\':3 }; summed = sum(sampl
Now you can make use of reduce function and get the sum.
reduce
const object1 = { 'a': 1 , 'b': 2 , 'c':3 } console.log(Object.values(object1).reduce((a, b) => a + b, 0));