Javatpoint Logo
Javatpoint Logo

JavaScript handler.preventExtensions() Method

The handler.preventExtensions() method is used to trap the Object.preventExtensions method. When extensions are prevented on an object, new properties can't be added.

Syntax

Parameters

target: The target object.

Return value

Return a Boolean value.

Browser Support

Chrome 49
Edge 12
Firefox 22
Opera 36

Example 1

Test it Now

Output:

true

Example 2

Test it Now

Output:

true 
[object Object] 
false

Example 3

Test it Now

Output:

false
 false

Next TopicJavaScript handler




Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA