javascript Prevent Object MutationPassed code example
Example: javascript Prevent Object MutationPassed
let obj = {
name:"FreeCodeCamp"
review:"Awesome"
};
Object.freeze(obj);
obj.review = "bad"; //will be ignored. Mutation not allowed
obj.newProp = "Test"; // will be ignored. Mutation not allowed
console.log(obj);
// { name: "FreeCodeCamp", review:"Awesome"}