Skip to main content

Function: isEqual()

isEqual<ValueType>(v1, v2, tolerance): boolean

Returns whether two values are equal or not, based on epsilon comparison. For array comparison, it does NOT strictly compare them but only compare its values. It can compare array of numbers and also typed array. Otherwise it will just return false.

Type Parameters

ValueType

Parameters

v1: ValueType

The first value to compare

v2: ValueType

The second value to compare

tolerance: number = 1e-5

The acceptable tolerance, the default is 0.00001

Returns

boolean

True if the two values are within the tolerance levels.

Defined in

packages/core/src/utilities/isEqual.ts:53