@playcanvas/observer
Version:
Generic implementation of the observer pattern
20 lines (19 loc) • 773 B
TypeScript
/**
* Determines whether two arrays are deeply equal. Two arrays are considered equal if they have the
* same length and corresponding elements are equal. This function also supports nested arrays,
* comparing them recursively.
*
* @param a - The first array to compare.
* @param b - The second array to compare.
* @returns Returns `true` if the arrays are deeply equal, otherwise `false`.
*
* @example
* arrayEquals([1, 2, 3], [1, 2, 3]); // true
* arrayEquals([1, 2, 3], [3, 2, 1]); // false
* arrayEquals([1, [2, 3]], [1, [2, 3]]); // true
* arrayEquals([1, [2, 3]], [1, [3, 2]]); // false
* arrayEquals([1, 2, 3], null); // false
* arrayEquals(null, null); // false
*/
declare const arrayEquals: (a: any[], b: any[]) => boolean;
export { arrayEquals };