How it works...

Writable is only part of the equation. Setting writable to false means that the property can be reassigned normally. By default, it cannot be redefined with Object.defineProperty. However, if configurable is set to true, then the property can be redefined. Once the configurable attribute is set to false, then we can no longer redefine it.

Get ECMAScript Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.