Skip to main content
InterviewHubPRO
Section Overview
Q194

Question 194 of 536

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

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

How do you determine whether object is frozen or not

mid LevelMost AskedCode ExampleEvent LoopPrototypes

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));