iter-fns - v0.13.0
    Preparing search index...

    Function chunks

    • Chunks an iterable into fixed-size chunks.

      The last chunk may be less than n if the total number of items does not divide by the chunk size.

      If the chunk size is larger than the iterable, all items in the iterable will be yielded.

      Type Parameters

      • T

        type of the item

      Parameters

      Returns ReverseSizedIterable<T[]>

      if n <= 0

    • Chunks an iterable into fixed-size chunks.

      The last chunk may be less than n if the total number of items does not divide by the chunk size.

      If the chunk size is larger than the iterable, all items in the iterable will be yielded.

      Type Parameters

      • T

        type of the item

      Parameters

      Returns SizedIterable<T[]>

      if n <= 0

    • Chunks an iterable into fixed-size chunks.

      The last chunk may be less than n if the total number of items does not divide by the chunk size.

      If the chunk size is larger than the iterable, all items in the iterable will be yielded.

      Type Parameters

      • T

        type of the item

      Parameters

      • iterable: Iterable<T>

        the iterable

      • n: number

        chunk size

      Returns Iterable<T[]>

      if n <= 0