Function arrShallowEquals

  • This function compares the length of the two arrays and then checks if each element at the corresponding index is equal.

    Type Parameters

    • T

      The type of the elements in the arrays.

    Parameters

    • input1: T[]

      The first array to compare.

    • input2: T[]

      The second array to compare. Checks if two arrays are shallowly equal.

    Returns boolean

    A boolean indicating whether the two arrays are shallowly equal.

    Example

    arrShallowEquals([1, 2, 3], [1, 2, 3]);
    //=> true
    arrShallowEquals([1, 2, 3], [1, 2, 4]);
    //=> false

Generated using TypeDoc