defineProperty < Object < JavaScript
The Object defineProperty() static method adds a property or modifies an existing property on an object and returns the object.
const object1 = {};
Object.defineProperty(object1, 'property1', {
value: 42,
writable: false,
});
console.log(object1.property1);
// 42