Object.isFrozen

Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object.

Syntax

isFrozen(object)

Parameters

Return value

true if the object is frozen, otherwise false.

Examples

let obj = {}
Object.freeze(obj)
Object.isFrozen(obj)
true
let obj = {}
Object.isFrozen(obj)
false
let obj = {}
Object.preventExtensions(obj)
Object.isFrozen(obj)
false