isEqual

Tests whether two values are equal.

IMPORT

import { isEqual } from "@donedeal0/superdiff";

FORMAT

Input

a: unknown;
b: unknown;
options: { ignoreArrayOrder: boolean }; // false by default
  • a: the value to be compared to the value b.

  • b: the value to be compared to the value a.

  • ignoreArrayOrder: if set to true, ["hello", "world"] and ["world", "hello"] will be treated as equal, because the two arrays contain the same values, just in a different order.

Output

boolean

USAGE

Input

isEqual(
  [ { name: "joe", age: 99 }, { name: "nina", age: 23 } ],
  [ { name: "joe", age: 98 }, { name: "nina", age: 23 } ],
);

Output

false;

Last updated