Function arraysAreEqual

  • Checks whether two arrays are equal.

    Type Parameters

    • TElement

      Array element type.

    Parameters

    • first: ArrayLike<TElement>

      First array to compare.

    • second: ArrayLike<TElement>

      Second array to compare.

    • Optional length: null | number

      The maximum number of elements to compare. Defaults to array length. Negative value means 0.

    Returns boolean

    true if up to length corresponding array elements are strictly equal to each other.

  • Checks whether two array ranges are equal.

    Type Parameters

    • TElement

      Array element type.

    Parameters

    • first: ArrayLike<TElement>

      First array to compare.

    • second: ArrayLike<TElement>

      Second array to compare. Negative or absent value means 0.

    • from: undefined | null | number

      The first element index to compare. Negative value means 0. Absent value means array length.

    • to: null | number

      The number one more than the last element index to compare.

    Returns boolean

    true if all corresponding elements in corresponding array ranges are strictly equal to each other.

  • Checks whether two arrays are equal by comparing corresponding elements with the given comparator function.

    Type Parameters

    • TElement

      Array element type.

    Parameters

    • first: ArrayLike<TElement>

      First array to compare.

    • second: ArrayLike<TElement>

      Second array to compare.

    • elementsAreEqual: ((this, first, second, index) => boolean)

      Array elements comparator. Accepts elements to compare and their index as arguments. Returns true if elements are equal, or false otherwise.

        • (this, first, second, index): boolean
        • Parameters

          • this: void
          • first: TElement
          • second: TElement
          • index: number

          Returns boolean

    • Optional length: null | number

      The maximum number of elements to compare. Defaults to array length.

    Returns boolean

    true if elementsAreEqual comparator returned true for up to length corresponding array element pairs.

  • Checks whether two array ranges are equal by comparing corresponding elements with the given comparator function.

    Type Parameters

    • TElement

      Array element type.

    Parameters

    • first: ArrayLike<TElement>

      First array to compare.

    • second: ArrayLike<TElement>

      Second array to compare.

    • elementsAreEqual: ((this, first, second, index) => boolean)

      Array elements comparator. Accepts elements to compare and their index as arguments. Returns true if elements are equal, or false otherwise.

        • (this, first, second, index): boolean
        • Parameters

          • this: void
          • first: TElement
          • second: TElement
          • index: number

          Returns boolean

    • from: undefined | null | number

      The first element index to compare. Negative value means 0. Absent value means array length.

    • to: null | number

      The number one more than the last element index to compare.

    Returns boolean

    true if elementsAreEqual comparator returned true for up to length corresponding array element pairs.

Generated using TypeDoc