Standard built-ins
Object.seal()
Prevents extensions and makes all own properties nonconfigurable. Existing writable data fields may still be assigned.
Formal Syntax & Structure
javascript syntaxjavascript
Object.seal(obj)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| obj | Object | Target object. |
Return Value
Object
Same target (or unchanged primitive).
Working Example
Example Snippetjavascript
const o=Object.seal({n:1});o.n=5;console.log(o.n,Object.isSealed(o));