JavaScript Object.is() Method

The Object.is() method of JavaScript is used to determine whether two values are the same value. There is a special built-in method that compares values.

Syntax:

Parameter

value1: The first value to compare.

value2: The second value to compare.

Return value:

This method returns a Boolean indicating whether or not the two arguments are the same value.

Browser Support:

Chrome30
EdgeYes
Firefox22
OperaYes

Example 1

Output:

false

Example 2

Output:

false
true

Example 3

Output:

 true
false





Latest Courses