Coggle requires JavaScript to display documents.
writable
var obj = { firstName: "Steven", lastName: "Smith", startDate: "January 10, 2015", type: "admin", }; Object.defineProperty(obj, "startDate", { writable: false }); obj.startDate = "April 20, 1968";
startDate
> Uncaught TypeError: Cannot assign to read only property 'startDate'
Object.seal(obj);
> Uncaught TypeError: Cannot add property newProp, object is not extensible
obj.newProp = true;
> Uncaught TypeError: Cannot delete property 'firstName'
delete obj.firstName;