1.0.1 • Published 4 years ago

@psdevs/js-utils v1.0.1

Weekly downloads
1
License
ISC
Repository
-
Last release
4 years ago

js-utils

Build Status Coverage Status

sumOf(array, ...keys) ⇒ number

ParamTypeDescription
arrayArray.<any>The array of objects with a shared shallow or nested property.
...keysstringThe property accessor(s) for the objects in the array.

Example

const data = [{ nested: { value: 12 } }, { nested: { value: 34 } }];

sumOf(data, "nested", "value"); // 46