Function sumByProperty

  • It will iterate through each element of the provided values array and add the value of each element's property to produce the desired sum.

    Type Parameters

    Parameters

    Returns number

    Since

    1.0.0

    Example

    sumByProperty([{ a: 1 }, { a: 2 }, { a: 3 }], "a"); // => 6