Skip to main content
Module

x/rimbu/mod.ts>Eq.iterableEq

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
function Eq.iterableEq
import { Eq } from "https://deno.land/x/rimbu@0.14.0/mod.ts";
const { iterableEq } = Eq;

Returns an Eq instance that compares Iterables by comparing their elements with the given itemEq Eq instance.

Examples

Example 1

const eq = Eq.iterableEq();
console.log(eq([1, 2, 3], [1, 2, 3])
// => true
console.log(eq([1, 2, 3], [1, 3, 2])
// => false

Parameters

optional
itemEq: Eq<T>
  • (optional) the Eq instance to use to compare the Iterable's elements

Returns

Eq<Iterable<T>>