Function isEqual

  • Checks if two values are equal, including support for Date, RegExp, and deep object comparison.

    Parameters

    • a: any

      The first value to compare.

    • b: any

      The second value to compare.

    Returns boolean

    true if the values are equal, otherwise false.

    isEqual(1, 1); // true
    isEqual({ a: 1 }, { a: 1 }); // true
    isEqual(/abc/g, /abc/g); // true
    isEqual(new Date('2020-01-01'), new Date('2020-01-01')); // true
    isEqual([1, 2, 3], [1, 2, 3]); // true