0 votes
in JavaScript by
What will be the output of the following JavaScript code?

const obj1 =  

{  

    property1:21  

}  

const descriptor1 =Object.getOwnPropertyDescriptor(obj1,'property1');  

console.log(descriptor1.configurable);  

console.log(descriptor1.enumerable);  

a) true 21

b) true false

c) false false

d) true true

1 Answer

0 votes
by

Answer: D

Reason: In JavaScript, "Object.getOwnPropertDescriptor()" provides the ability to query information about a property in detail. It returns a property's descriptor for that property, which directly presents on an object and not present in the object's prototype of the certain object.

...