Lesson

Clone Objects and Copy Properties with ES2017 Property Descriptors

Property descriptors describe the attributes of a property (its value, whether it is writable, etc.).

Duration
5 min
Access
Pro
Transcript
Available

Property descriptors describe the attributes of a property (its value, whether it is writable, etc.).

We will look at Object.getOwnPropertyDescriptors() and present different use cases that it can be used in such as cloning objects, copying properties into an object.

Property descriptors are not available in all browsers, example code will be added when available.