c930535
1
2
const o={"x":2,"y":1,"z":8,"w":6};const sum=Object.keys(o).reduce((a,k)=>a+o[k],0);console.log(JSON.stringify(o),sum);