ixfx
    Preparing search index...

    Function enumerateNumericalValues

    • Yields numerical values based on the an input of objects and the property to use.

      const data = [
      { size: 10 }, { size: 20 }, { size: 0 }
      ]
      [...enumerateNumericalValues(data, `size`)]; // [ 10, 20, 0 ]

      If any of objects has a non numerical value for propertyName, a TypeError is thrown.

      Parameters

      • records: Record<string, unknown>[]
      • propertyName: string

      Returns Generator<number, void, unknown>