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

x/rimbu/core/main/exports.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@1.0.3/core/main/exports.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