• Computes the sum of the values in array, but it accepts predicate which is invoked for each element in array to generate the value to be summed

    Parameters

    • arr: Record<string, any>[]
    • predicate: string | ((o) => number)

    Returns number

    Example

    generateSumByTheGivenPredicate([1,2,3], x => x*2);
    // returns 12

Generated using TypeDoc