Object.freeze() JavaScript

The JavaScript Object freeze() method prevents existing properties from being modified and the new properties from being added on the specific object. Syntax: Object.freeze(object) Parameters: object: It represents the object on which new properties are to be added or modified. Return: Given object. Example: <!DOCTYPE html> <html> <body> <script> const obj = { prop: 56 … Read more