The type of the input value.
The value to be checked.
true if the value is a frozen object, otherwise false.
A frozen object is an object whose properties:
This function only returns true for actual object values. It avoids the
coercion behavior of Object.isFrozen, which returns true for all
non-object (primitive) values.
| Value | Result | Object.isFrozen |
|---|---|---|
Object.freeze( {} ) |
true |
true |
Object.seal( {} ) |
true |
true |
{} |
false |
false |
[] |
false |
false |
null |
false |
true |
undefined |
false |
true |
123 |
false |
true |
Determines whether the provided value is a frozen object.
Important Note:
JavaScript considers an object "frozen" if it is non-extensible and all of its properties are non-configurable and non-writable.
This leads to a subtle edge case:
{}) that is sealed or made non-extensible is also considered frozen, even ifObject.freezewas never called.