Opens in a new tab
A picture of Jeff Brigman
I CODE TODAY FOR
A BETTER TOMORROW

Glossary Term

Object.preventExtensions()

2 tags 1 category

The Object.preventExtensions() static method prevents new properties from ever being added to an object (i.e., prevents future extensions to the object). It also prevents the object’s prototype from being re-assigned.

An object is extensible if new properties can be added to it. Object.preventExtensions() marks an object as no longer extensible, so that it will never have properties beyond the ones it had at the time it was marked as non-extensible. Note that the properties of a non-extensible object, in general, may still be deleted. Attempting to add new properties to a non-extensible object will fail, either silently or, in strict mode, throwing a TypeError.

Syntax example: Object.preventExtensions(obj)

Term Connections

Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.

Loading term connections…