arrayEqual

Checks if two given arrays are equal in value and order.

This function is order-sensitive. This means, two arrays are only equal if they have the same values and are in the same order.

import { arrayEqual, cloneArray } from '1loc'

const arr1 = [2, 3, 4]
const arr2 = cloneArray(arr1)

arrayEqual(arr1, arr2) // true
arrayEqual(arr1, [3, 2, 4]) // false

Last updated