import { includes } from "https://deno.land/x/iter@v3.2.3/lib/reducers.ts";
- Determines whether an iterable includes a certain element, returning true or false as appropriate.
-
warning: When ran on an endless iterable which does not contain
value
, this function never returns.
Examples
Example 1
Example 1
import * as iter from "https://deno.land/x/iter";
const naturals = iter.create.increments(1);
const has100 = iter.includes(naturals, 100);
console.log(has100); // -> true
// Will never return.
// const has0 = iter.includes(naturals, 0);