Chapter 7: Object properties configuration
7.1 Property flags and descriptors
Property flags
Get the flags
let descriptor = Object.getOwnPropertyDescriptor(obj, propertyName);let user = {
name: "John"
};
let descriptor = Object.getOwnPropertyDescriptor(user, 'name');
/* property descriptor:
{
"value": "John",
"writable": true,
"enumerable": true,
"configurable": true
}
*/Change the flags
Multiple properties
7.2 Property getters and setters
Getters and setters
Accessor descriptors
Smarter getters/setters
Last updated