1const object = {
2 name = "John",
3};
4
5object = "Test"; // Doesn't work, constant makes it so you can't reasign it
6
7object.name = "Doo"; // This works
8
9Object.freeze(object)
10
11object.name = "Foo"; // No longer works
1 const obj = {
2 prop: 42
3 };
4
5 Object.freeze(obj);
6
7 obj.prop = 33;
8// //Throws an error in strict mode.
9
10 console.log(obj.prop);
11// expected output: 42
12