isEqual
Determine if two values are equal
456 bytes
Usage
Given two values, returns true if they are equal.
import * as import _
_ from 'radashi'
import _
_.isEqual<null>(x: null, y: null): booleanexport isEqual
Return true if the given values are equal.
To determine equality, Object.is() is used first. If it returns
false, we do the following special checks:
Date and Date with the same time
RegExp and RegExp with the same pattern/flags
- object with the same keys and values (recursive)
isEqual(null, null) // => trueimport _
_.isEqual<never[]>(x: never[], y: never[]): booleanexport isEqual
Return true if the given values are equal.
To determine equality, Object.is() is used first. If it returns
false, we do the following special checks:
Date and Date with the same time
RegExp and RegExp with the same pattern/flags
- object with the same keys and values (recursive)
isEqual([], []) // => true
import _
_.isEqual<string>(x: string, y: string): booleanexport isEqual
Return true if the given values are equal.
To determine equality, Object.is() is used first. If it returns
false, we do the following special checks:
Date and Date with the same time
RegExp and RegExp with the same pattern/flags
- object with the same keys and values (recursive)
isEqual('hello', 'world') // => falseimport _
_.isEqual<number>(x: number, y: number): booleanexport isEqual
Return true if the given values are equal.
To determine equality, Object.is() is used first. If it returns
false, we do the following special checks:
Date and Date with the same time
RegExp and RegExp with the same pattern/flags
- object with the same keys and values (recursive)
isEqual(22, 'abc') // => falseError ts(2345) ―