The match condition of element to find.
The found positions.
import { findIndices, fromArray } from "./list.ts";
import * as Option from "./option.ts";
import { assertEquals } from "../deps.ts";
const list = fromArray([1, 4, 2, 3, 5]);
assertEquals(findIndices((x: number) => 4 <= x)(list), [1, 4]);
assertEquals(findIndices((x: number) => 0 <= x)(list), [0, 1, 2, 3, 4]);
assertEquals(findIndices((x: number) => 8 <= x)(list), []);
Generated using TypeDoc
Finds the positions of element which satisfies
pred
in the list. If the list is infinite, this will hang forever.