Skip to main content
Version: 3.27.2

Reflect.preventExtensions()

The static Reflect.preventExtensions() method prevents new properties from ever being added to an object (i.e., prevents future extensions to the object). It is similar to Object.preventExtensions(), but with some differences.

Syntax

Reflect.preventExtensions(target)

Parameters

  • target
    • : The target object on which to prevent extensions.

Return value

A Boolean indicating whether or not the target was successfully set to prevent extensions.

Exceptions

A TypeError, if target is not an Object.