arrayHasSameValues

Checks if given arrays have similar values

This works like arrayEqual but isn't order-sensitive. This means two arrays are equal if they have the same values irrespective of the arrangement of those values.

import { arrayHasSameValues } from "1loc";

arrayHasSameValues([2, 3], [3, 2]) // true
arrayHasSameValues([1, 2], [1, 4]) // false

Last updated