
Business Intelligence as a Service
Try PlusClouds Eaglet service and find high quality B2B hot leads and opportunites with AI support.
Objects and arrays in JavaScript are mutable. This means that we can change an object (or an array) whenever we want. But if we don't want that to happen for any reason and want to make the object immutable.
We can do this using the freeze() method.
An object that you freeze with the freeze() method can no longer be changed; freezing an object with freeze prevents adding new properties, removing existing properties, changing the enumerability, configurability, or writability of existing properties, and changing the values of existing properties. Additionally, freezing an object also prevents the prototype from being modified.
const obj = {
name: "Jack"
};
Object.freeze(obj);
obj.name = "Kelly";
// Throws an error in strict mode
console.log(obj.name);
// expected output: "Jack"
If you are a journalist, who has desire to dig deep in topics related to businesses and sectors, we want to work with you!
With the AutoQuill tool that PlusClouds has started to offer to its affiliate partners, content creators will be able to sell with a single click. Let us show you how you can get your share of this revolution.