Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/ahh/mod.ts>I.any

Idiomatic type-safety functions.
Go to Latest
method I.any
import { I } from "https://deno.land/x/ahh@v0.10.3/mod.ts";

Consumes an Iterator until f returns true, and returns true if it does.

Examples

Example 1

import { I } from "./mod.ts";

const iter = I.iter([2, 4, 6]);

console.log(I.any(iter, (i) => i > 4)); // true
console.log(I.any(iter, (i) => i > 6)); // false

Parameters

iter: Iterator<T>
f: (_: T) => boolean

Returns

boolean