JavaScript Object.freeze() MethodThe Object.freeze() method freezes an object that prevents new properties from being added to it. This method prevents the modification of existing property, attributes, and values. Syntax:ParameterObj: The object to freeze. Return value:This method returns the object that was passed to the function. Browser Support:
Example 1Output: 22 Example 2Output: " freeze " Example 3Output: [object Object] { name: "charry", prop: function() {} } [object Object] { name: "karri" } [object Object] { name: "karri" }
Next TopicJavaScript Objects
|