Freeze and Seal Objects in JavaScript

Adnan Ahmed
4 min readDec 25, 2020

Variables we declare in javascript with the help of const, are not purely constant. Let's say that if we have a variable called config with a bunch of properties and if we print it to the console you will see it has a name and a database object.

const config = {
name: "module-account",
database: {
host: "127.0.0.1",
port: "2020",
username: "admin",
password: "r@@t",
},
};
console.log(config); //

--

--

Adnan Ahmed

A software engineer sharing insights and experiences through blog posts. Delving into technical topics and occasional general musings. https://adnanahmed.info