mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-22 11:36:23 +00:00
17 lines
325 B
Markdown
17 lines
325 B
Markdown
|
---
|
||
|
id: 5af724a3-745d-45a2-9d5f-e62dc9a22264
|
||
|
title: Object.is
|
||
|
---
|
||
|
|
||
|
# Description
|
||
|
|
||
|
`Object.is` provides a way of comparing values that's more precise than
|
||
|
`===`
|
||
|
|
||
|
``` javascript
|
||
|
console.log(NaN === NaN) // false
|
||
|
console.log(Object.is(NaN, NaN)) //true
|
||
|
console.log(-0 === +0) // true
|
||
|
console.log(Object.is(-0, +0)) // false
|
||
|
```
|