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.

Related questions

0 votes
asked Mar 22, 2021 in JavaScript by Robindeniel
0 votes
asked Mar 24, 2021 in JavaScript by sharadyadav1986
...