Object.getOwnPropertyDescriptors() is often used to clone objects while preserving getters, setters, and property attributes: