getOwnPropertyDescriptors
getOwnPropertyDescriptors is a static method of the Object object in JavaScript that returns all own property descriptors of a given object. It takes an object as an argument and returns a new object. This new object contains key-value pairs where the keys are the property names of the original object, and the values are the corresponding property descriptors. A property descriptor is an object that describes the characteristics of a property.
These descriptors contain four possible attributes: value, writable, enumerable, and configurable. The value attribute holds the
getOwnPropertyDescriptors is useful for tasks such as cloning objects with their full property configurations, inspecting property