The type of the input value.
The value to be checked.
true if the value is a sealed object, otherwise false.
A sealed object is an object whose properties:
However, existing property values may still be changed if they are writable.
This function only returns true for actual object values. It avoids the
coercion behavior of Object.isSealed, which returns true for all
non-object (primitive) values.
In contrast, Object.isSealed treats primitives such as null,
undefined, numbers, and strings as already sealed, which can lead
to misleading results when performing runtime validation.
| Value | Result | Object.isSealed() |
|---|---|---|
Object.freeze( {} ) |
true |
true |
Object.freeze( [] ) |
true |
true |
Object.seal( {} ) |
true |
true |
Object.seal( [] ) |
true |
true |
{} |
false |
false |
[] |
false |
false |
new Date() |
false |
false |
null |
false |
true |
undefined |
false |
true |
123 |
false |
true |
'text' |
false |
true |
Determines whether the provided value is a sealed object.
Important Note:
Empty objects (
{}) that are made non-extensible (viaObject.preventExtensions) are also considered sealed, since there are no properties that violate the constraint.