InterviewHubPRO
Section Overview
Q194

Question 194 of 521

Part 4: Prototypes, Object Methods & Event Loop (174 - 253)

37%
JavaScript Internals (521 Qs)•Part 4: Prototypes, Object Methods & Event Loop (174 - 253)

How do you determine whether object is frozen or not

Object.isFrozen() method is used to determine if an object is frozen or not.An object is frozen if all of the below conditions hold true,

  1. If it is not extensible.
  2. If all of its properties are non-configurable.
  3. If all its data properties are non-writable. The usage is going to be as follows,
javascript
  const object = {
    property: "Welcome JS world",
  };
  Object.freeze(object);
  console.log(Object.isFrozen(object));