Function looseArrayEqual

  • Check if two objects are loose equal, this will not check whether the two arrays are in the same order

    example:

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

    expect(looseArrayEqual(arr1, arr2)).toBeTruthy()
    expect(looseArrayEqual(arr1, arr3)).toBeTruthy()
    expect(looseArrayEqual(arr1, arr4)).toBeFalsy()
    })

    Parameters

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

    Returns boolean

Generated using TypeDoc