Monday, August 24, 2026
Latest:
  • Präsentation für b1
  • Verb “werden” Konjugation
  • In German, verb sein (to be) Konjunktion
  • Wichtige wörter für B1 prüfung
  • What are the main differences between ApplicationContext and BeanFactory?
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

Why next-gen image formats (JPEG2000, WebP) are better compare to JPEG, PNG formats?

January 8, 2021 beroza

How to check an object is empty in JavaScript?

August 13, 2021 beroza

Warning: mysqli_connect(): (HY000/2002): No such file or directory

April 29, 2021 beroza

Write a program to generate a string with characters that have odd counts

June 8, 2022 beroza

When to use primitive and when reference types in Java?

May 26, 2020 beroza

How to test a function inside a stateless component using JEST in ReactJS?

April 25, 2021 beroza

What is useRef in React? What are the use cases of useRef?

August 14, 2021 beroza

How to copy WordPress live database to local database?

May 17, 2019 beroza

Check If a String Can Break Another String

June 11, 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.