Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

take

import { take } from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/iterable.ts";

Take the first n elements from an Iterable.

@example
import * as I from "./iterable.ts";

const numbers = I.wrap(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
const firstThree = I.take(3)(numbers);

const result = Array.from(firstThree); // [1, 2, 3]
function take(n: number): <A>(ta: Iterable<A>) => Iterable<A>;
§
take(n: number): <A>(ta: Iterable<A>) => Iterable<A>
[src]

§Parameters

§
n: number
[src]

§Return Type

§
<A>(ta: Iterable<A>) => Iterable<A>
[src]