C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
JavaScript Object.is() MethodThe 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:Object.is(value1, value2); Parametervalue1: 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:
Example 1const object1 = {}; console.log(Object.is(object1)); Output: false Example 2const object1 = { property1: 56 }; console.log(Object.is(object1)); Object.seal(object1); console.log(Object.isSealed(object1)); Output: false true Example 3const object1 = {}; console.log(Object.isExtensible(object1)); console.log(Object.is(object1)); Output: true false
Next TopicJavaScript Objects
|