Function meanByProperty

  • It will iterate through each of the provided values array and add the value of each element's property, then divide by values.lengthto produce the desired mean.

    Type Parameters

    Parameters

    Returns number

    Since

    1.0.0

    Example

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