SheetXL - v0.8.0-beta.9+sites.210.e2d420901
    Preparing search index...

    Function isEqualArrays

    • 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

      Parameters

      • a: readonly T[]

        The first array to compare.

      • b: readonly T[]

        The second array to compare.

      • OptionalisEqual: (a: T, b: T) => boolean

        Function to compare two elements of type T. Defaults to strict equality.

      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