ixfx
    Preparing search index...

    Function filterWithIndex

    • Enumerates the index of all array values that match predicate.

      const data =  [`red`,`blue`,`red`,`blue`,`red`];
      for (const index of filterWithIndex(data, v=> v === `red`)) {
      // Yields 0, 2, 4
      }

      Type Parameters

      • V

      Parameters

      • array: readonly V[]
      • predicate: (value: V, index: number, obj: readonly V[]) => boolean

      Returns Generator<number>