Skip to main content
Module

x/ahh/mod.ts>Iterator#all

Opinionated idiomatic features for TypeScript.
Go to Latest
method Iterator.prototype.all
import { Iterator } from "https://deno.land/x/ahh@v0.13.0/mod.ts";

Consumes this and returns whether fn returns true for all items.

Examples

Example 1

import { assert } from "../test_deps.ts";
import I from "./iterator.ts";

const odd = (i: number): boolean => i % 2 !== 0;
const iter = I.fromIter([1, 3, 5]);

assert(iter.all(odd));

Parameters

fn: (item: T) => boolean

Returns

boolean