Wednesday, April 1, 2026
Latest:
  • In German, verb sein (to be) Konjunktion
  • 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?
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

Add new users to an Amazon EC2 Ubuntu instance and allow SSH access

July 22, 2020 beroza

How to append and prepend using JavaScript?

May 31, 2021 beroza

How to setup Jest and Enzyme in existing React application?

September 26, 2020 beroza

What are the differences between application server and a servlet container?

November 25, 2019 beroza

How small should the microservice be for applications?

June 18, 2020 beroza

Write a program to check a number is palindrome or not?

December 5, 2021 Avijit Paul

Reactjs app should use a boilerplate or use create-react-app from Facebook?

January 2, 2019 beroza

Security best practices for React application

June 13, 2022 beroza

Maximum Score After Splitting a 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 © 2026 Upokary. All rights reserved.