JavaScript Object.seal() Method

The Object.seal() method of JavaScript seals an object which prevents new properties from being added to it and marks all existing properties as non-configurable. The object to be sealed is passed as an argument, and the method returns the object which has been sealed.

Syntax:

Parameter:

obj: It is the object which should be sealed.

Return value:

The Object.sealed() method returns the object which has been sealed.

Browser Support:

Chrome6
EdgeYes
Firefox4
Opera12

Example 1

Output:

"carry"

Example 2

Output:

 45

Example 3

Output:

45
45
67





Latest Courses