BY Simmi Kava2 Jun 2021 Edit
JavaScript: Object.freeze() -yields "true"

Object.freeze()


As we already know, Object.freeze() method freezes an object which means, object can no longer be changed, no new properties can be added, existing properties and their values cannot be modified.

In one of our previous blog, we had already explained the CRUD operations on Object.freeze(), Object.seal() and Object.preventExtensions() method. Here is the quick reference.

CRUD Operations - Object - freeze() | seal() | preventExtensions()

Object.freeze(100) === 100 //true

Object.freeze(null) === null //true

Object.freeze() === undefined //true

Object.freeze(undefined) === undefined //true

If we see in the above example, if the argument is not an object i.e. is number, null or undefined, Object.freeze() has no impact and does not do anything and always the result of strict comparison is true.

Same goes with Object.preventExtensions(). Let's see the example below:-

Object.preventExtensions(100) === 100 //true

Object.preventExtensions(null) === null //true

Object.preventExtensions() === undefined //true

Object.preventExtensions(undefined) === undefined //true
BY Simmi Kava
LikeCommentSave
LikeCommentSaveShare
0
Categories
General
YantraJS
Developer Guides
Tutorials
Web Atoms Updates

POPULAR POSTS
17 Mar 2021
LATEST ACTIVITY
Simmi Kava
commented this post.
Simmi Kava
liked this post.
Show more
ARCHIVES
2025
2024
2023
2022
TAGS
javascript (56)
developer (25)
javascriptdeveloper (16)
Xamarin.Forms (16)
Html (14)
typescript (12)
webatoms (12)
xamarin (11)
coding (10)
web-atoms (10)
arrays (9)
android (8)
javascript-developer (8)
csharp (7)
dotnet (7)
css (6)
update (6)
dotnet-standard (5)
function (5)
iOS (5)
methods (4)




Web Atoms: JSX (TSX + TypeScript) for Xamarin.Forms, Hot Reload Your App in Production Environment

PlaygroundSamples Repository