Gets the difference of the two arrays or sets
Example:
import { difference } from "@thalesrc/js-utils/array";
const base = ["a", "b", "c", "d", "a", "b", "c", "d"];
difference(base, ["a", "b"]); // ["c", "d", "c", "d"]
difference(base, ["a", "b"], true); // ["c", "d", "a", "b", "c", "d"]
Array Prototype Example:
import "@thalesrc/js-utils/array/proto/difference";
const base = ["a", "b", "c", "d", "a", "b", "c", "d"];
base.difference(["a", "b"]); // ["c", "d", "c", "d"]
Set Prototype Example:
import "@thalesrc/js-utils/set/proto/difference";
const base = new Set(["a", "b", "c", "d"]);
base.difference(["a", "b"]); // Set(["c", "d"])
Base Set or Array
Set or Array to remove its values from the base
By default all the same items encountered in substraction will be removed, set this argument as true to get real difference
Difference of base from substraction
Generated using TypeDoc
Difference Substraction Type