Object

Object.isFrozen

Determines if an object is frozen

Syntax

JavaScript
Object.isFrozen(obj)

Parameters

ParameterTypeDescription
objanyThe object to check

Return Value

true if the object is frozen, false otherwise

Examples

Basic Usage
const obj = { a: 1 };
console.log(Object.isFrozen(obj)); // false
Object.freeze(obj);
console.log(Object.isFrozen(obj)); // true
Practical Example
console.log(Object.isFrozen(42)); // true (primitives are frozen)
console.log(Object.isFrozen('hello')); // true
Advanced Usage
const empty = {};
Object.preventExtensions(empty);
console.log(Object.isFrozen(empty)); // true

Understanding Object.isFrozen

The Object.isFrozen method in JavaScript determines if an object is frozen. It belongs to the Object object and is one of the most widely used methods for working with object values in modern JavaScript and TypeScript applications.

The method signature is Object.isFrozen(obj). It accepts 1 parameter: obj. When called, it returns true if the object is frozen, false otherwise. Understanding when and how to use isFrozen() helps you write more expressive, readable code.

Common use cases for Object.isFrozen include data transformation, input validation, API response processing, and building reusable utility functions. It works well alongside related methods like object-freeze, object-seal, object-issealed, enabling you to chain operations together for complex data manipulation pipelines.

Browser support for Object.isFrozen is excellent across all modern browsers including Chrome, Firefox, Safari, and Edge. It is also fully supported in Node.js and Deno. For older environments, transpilation with Babel or a polyfill may be needed.

Browser Compatibility

Supported in all modern browsers (Chrome, Firefox, Safari, Edge) and Node.js. Part of the ECMAScript standard.

Related Methods

More Object Methods

Other methods in the Object object

Related Tools

More Object Methods

Explore JavaScript Methods

Browse our complete reference of 410 JavaScript methods with syntax, examples, and explanations.