wiki/content/20201113095300-object_is.md

18 lines
342 B
Markdown
Raw Normal View History

2024-05-06 20:40:05 +00:00
---
2024-10-29 18:27:12 +00:00
date: 2020-11-13
2024-05-06 20:40:05 +00:00
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
```