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

std/assert/mod.ts>equal

The Deno Standard Library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
function equal
Re-export
import { equal } from "https://deno.land/std@0.222.0/assert/mod.ts";

Deep equality comparison used in assertions

Examples

Example 1

import { equal } from "https://deno.land/std@0.222.0/assert/equal.ts";

equal({ foo: "bar" }, { foo: "bar" }); // Returns `true`
equal({ foo: "bar" }, { foo: "baz" }); // Returns `false

Parameters

c: unknown

actual value

d: unknown

expected value

Returns

boolean