SheetXL - v0.3.20
    Preparing search index...
    • Checks whether two arrays are equal in terms of length and element values.

      The function compares the arrays for strict equality (===) for each element. It first checks if the arrays reference the same object and returns true in that case. If not, it ensures both arguments are arrays of the same length, and then compares their elements.

      Type Parameters

      • T = any

        The type of the elements in the arrays.

      Parameters

      • a: T

        The first array to compare.

      • b: T

        The second array to compare.

      Returns boolean

      true if the arrays are equal in length and content, false otherwise.

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