Skip to main content
Module

x/rimbu/mod.ts>Eq.valueOfEq

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

Returns an Eq instance for objects that have a valueOf method. It returns true if the .valueOf values of both given objects are equal.

Examples

Example 1

const eq = Eq.valueOfEq()
console.log(eq(new Number(5), new Number(5)))
// => true
console.log(eq(new Number(5), new Number(3)))
// => false

Type Parameters

T extends { valueOf(): V; }
V