How to sum the values of a JavaScript object? ... It can be as simple as that: const sumValues = obj => Object.values(obj).reduce((a, b) => a + b);. Quoting MDN:.
確定! 回上一頁