106
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:
Chrome | 30 |
Edge | Yes |
Firefox | 22 |
Opera | Yes |
Example 1
Output:
false
Example 2
Output:
false true
Example 3
Output:
true false
Next TopicJavaScript Objects