@psdevs/js-utils
v1.0.1
Published
Some handy javascript utilities we use π¨βπ»π©βπ»
Downloads
1
Maintainers
Readme
js-utils
sumOf(array, ...keys) β number
| Param | Type | Description | | --- | --- | --- | | array | Array.<any> | The array of objects with a shared shallow or nested property. | | ...keys | string | The property accessor(s) for the objects in the array. |
Example
const data = [{ nested: { value: 12 } }, { nested: { value: 34 } }];
sumOf(data, "nested", "value"); // 46