Skip to content

Latest commit

 

History

History
47 lines (39 loc) · 1.21 KB

File metadata and controls

47 lines (39 loc) · 1.21 KB
title ms.custom ms.date ms.prod ms.reviewer ms.suite ms.technology ms.tgt_pltfrm ms.topic dev_langs ms.assetid caps.latest.revision author ms.author manager
Object.is Function (JavaScript) | Microsoft Docs
01/18/2017
windows-client-threshold
devlang-javascript
language-reference
JavaScript
TypeScript
DHTML
6e2f6c6d-7cd2-47c4-a513-3ba53988d27d
2
mikejo5000
mikejo
ghogen

Object.is Function (JavaScript)

Returns a value that indicates whether two values are the same value.

Syntax

Object.is(value1, value2)  

Parameters

value1
Required. The first value to test.

value2
Required. The second value to test.

Return Value

true if the value is the same value; otherwise, false.

Remarks

Unlike the == operator, Object.is does not coerce any types when testing values.

The comparison applied by Object.is is similar to the comparison applied by the === operator, except that Object.is treats Number.isNaN as the same value as NaN. It also treats +0 and -0 as different values.

Requirements

[!INCLUDEjsv12]