What will be the output of the following JavaScript code? [code] const object1 = { property1: 20 }; console.log(Object.is(object1));

What will be the output of the following JavaScript code?
Code:
const object1 = {  
  property1: 20
};  
console.log(Object.is(object1));
A. 20
B. true
C. false
D. error
 
Answer: c
Explanation: 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. This method returns a Boolean indicating whether or not the two arguments are the same value.
 

Tìm kiếm

Back
Top