How to make an object immutable in JavaScript?
Originally posted here!
To make an object read only or immutable you can use the Object.freeze() method.
Consider this object,
const Car = {
name: "Audi",
year: "2020",
};
We don't want any more properties to be added to this Car object.
Let's...
melvingeorge-me.hashnode.dev2 min read