Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/rimbu/common/internal.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.13.0/common/internal.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>>