Function shallowArrayEqual

  • Check if two arrays are shallow equal, this also checks if the two arrays are in the same order

    example:

    it('test shallowArrayEqual function', () => {
    const arr1 = [1, 2, 3]
    const arr2 = [1, 2, 3]
    const arr3 = [1, 3, 2]

    expect(shallowArrayEqual(arr1, arr2)).toBeTruthy()
    expect(shallowArrayEqual(arr1, arr3)).toBeFalsy()

    Parameters

    • arr1: any[]
    • arr2: any[]

    Returns boolean

Generated using TypeDoc