import { takeGenerator } from "https://deno.land/x/froebel@v0.23.2/take.ts";
Takes n
elements from the iterable list
and returns them as a generator.
Examples
Example 1
Example 1
[...take(5, repeat(1, 2))] // -> [1, 2, 1, 2, 1]
[...take(3, [1, 2, 3, 4])] // -> [1, 2, 3]
[...take(3, [1, 2])] // -> [1, 2]
Parameters
list: Iterable<T>