When using Object.freeze() on an object, attempting to modify a property of the frozen object will result in a TypeError being thrown, as the properties of the object become immutable.
18.
How can you check if an object is frozen in JavaScript?
You can check if an object is frozen in JavaScript using the frozen property, the isFrozen() method, or the Object.isFrozen() method, all of which indicate if the object is frozen.
19.
Which statement about constant objects in JavaScript is correct?
Constant objects in JavaScript prevent the addition or removal of properties, but their properties can be modified, contrary to the notion that constant objects are immutable.
20.
What happens if you try to delete a property from a constant object in JavaScript?
Attempting to delete a property from a constant object in JavaScript will result in a SyntaxError being thrown, as constant objects do not allow the addition or removal of properties.