Adds a property to an object, or modifies attributes of an existing property.
defineProperty(object, propertyName, attributes)
object
Object on which to add or modify the property.
propertyName
The property name.
attributes
Descriptor for the property.
The object that was passed to the function.
let obj = {}
Object.defineProperty(obj, "speed", {
value: 120,
writable: true
});
obj.speed
120