It will iterate through each element of the provided values array, by the provided iteratee function and add the resulting numbers returned by the said iteratee function to produce the desired sum.
values
iteratee
sum
1.0.0
sumByFn([1, 2, 3], number => number);// => 6 Copy
sumByFn([1, 2, 3], number => number);// => 6
sumByFn([{ a: 1 }, { a: 2 }, { a: 3 }], ({ a }) => a);// => 6 Copy
sumByFn([{ a: 1 }, { a: 2 }, { a: 3 }], ({ a }) => a);// => 6
It will iterate through each element of the provided
values
array, by the providediteratee
function and add the resulting numbers returned by the saiditeratee
function to produce the desiredsum
.