@jonahsnider/util

    Function skip

    • Returns an iterator that skips the first count elements of an iterable.

      Time complexity: O(n)

      Space complexity: O(1)

      Type Parameters

      • T

      Parameters

      • iterable: Iterable<T>

        The iterable to skip elements from

      • count: number

        The number of elements to skip

      Returns Iterator<T>

      The iterator that skips the first count elements of iterable

      Iterable

      const iterable = [1, 2, 3, 4, 5];

      const iterator = skip(iterable, 2);

      iterator.next(); // { value: 3, done: false }
    MMNEPVFCICPMFPCPTTAAATR