Saturday, December 6, 2025
Latest:
  • Wichtige wörter für B1 prüfung
  • What are the main differences between ApplicationContext and BeanFactory?
  • German B1 Word list
  • How does Lazy annotation work in Spring?
  • How Spring framework resolves circular dependencies?
Upokary

Upokary

Quality information

  • Health
  • Life
  • Fashion
  • Food
  • Code
  • English
  • বাংলা
Technology 

How to stop adding, modifying and deleting an object’s properties?

Published: August 7, 2021 freeze, JavaScript, object

In JavaScript, we can use the freeze() method of Object to stop adding, modifying, and deleting an object’s properties. The freeze() method will only allow us to read properties. It will not allow adding, modify and delete operations to the object.

Following is the code sample:

const userObj = {
    name: 'Joe Smith',
    gender: 'Male',
    age: 40
}

Object.freeze(userObj);
userObj.age = 50;
console.log(userObj);

You May Also Like

How to merge two array of objects and make it unique based on a property?

April 12, 2021 beroza

TypeError: Cannot read property ‘prepareStyles’ of undefined

October 23, 2019 beroza

Find the missing number in the array using JavaScript.

February 10, 2022 beroza

How to add multiple language support in ReactJS with i18next and react-i18next?

September 30, 2020 beroza

How to solve “Add Expires headers” of GTMatrix for websites?

January 5, 2020 beroza

Wikipedia is full of quality information, please donate

January 23, 2019 beroza

What are new in Java 14 or new features of Java 14

August 4, 2020 beroza

What is Arc publishing? Explain the Arc publishing architecture

July 18, 2019 beroza

Write a Program to Reformat The String

January 10, 2023 beroza

Why Upokary?

Upokary.com is a useful application in everyday life. It provides very handy information regarding every aspect of life. Each and every tip of upokary.com is meant to make life better.

Upokary tools

  • Youtube thumbnail
  • Youtube video downloader

Useful Links

  • Handy code
  • Technology
  • People
  • Programming
  • Quote
  • Travel
  • WordPress
  • IELTS
  • Kids

Pages

  • Sitemap
  • Privacy policy
  • About us
  • Contact us

Support

For any kind of query or question please drop a message in the following email: upokary@gmail.com
Copyright © 2025 Upokary. All rights reserved.