Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the output of the following JavaScript code?
const prototype1 = {};
const object1 = Object.create(prototype1);
console.log(Object.getPrototypeOf(object1) === prototype1);

What will be the output of the following JavaScript code?
const prototype1 = {};
const object1 = Object.create(prototype1);
console.log(Object.getPrototypeOf(object1) === prototype1);
a) True
b) False
c) error
d) 0

Answer: a
Explanation: The Object.getPrototypeOf() method of JavaScript returns the prototype value of the specified object. There are no inherited properties in this object.

Join The Discussion