Write Your JavaScript Code Here

const object1 = {}; // Creates an empty object and assigns it to the variable "object1" Object.defineProperty(object1, 'property1', { // Defines a new property 'property1' on object1 value: 22, // Sets the value of the 'property1' property to 22 }); object1.property1; // Accesses the value of 'property1' on object1 console.log(object1.property1); // The line above would throw an error in strict mode because the property 'property1' was defined using defineProperty with no getter or setter, // so attempting to read it would result in an error due to the property being non-configurable and non-writable.

Output: