[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [Eq](https://evolu.dev/docs/api-reference/common/Eq) › eqSameValueZero

```ts
function eqSameValueZero<A>(x: A, y: A): boolean;
```

Defined in: [packages/common/src/Eq.ts:67](https://github.com/evoluhq/evolu/blob/ca15b4661c40fedb9f47434497086039cbdea38e/packages/common/src/Eq.ts#L67)

Compares two values using SameValueZero equality.

SameValueZero is the standard equality algorithm used by `Map`, `Set`, and
`Array.prototype.includes`. It behaves like strict equality except that `NaN`
equals itself. Both algorithms consider `0` and `-0` equal.

### Example

```ts

expect(eqSameValueZero(NaN, NaN)).toBe(true);
expect(eqSameValueZero(0, -0)).toBe(true);
expect(eqSameValueZero({}, {})).toBe(false);
```