An Interest In:
Web News this Week
- April 26, 2024
- April 25, 2024
- April 24, 2024
- April 23, 2024
- April 22, 2024
- April 21, 2024
- April 20, 2024
August 20, 2021 02:03 pm GMT
Original Link: https://dev.to/antoomartini/differences-between-object-freeze-and-object-seal-in-javascript-n11
Differences between Object.freeze( ) and Object.seal( ) in Javascript
They are functions that may appear to do the same action but have significant differences. And it was difficult for me to learn it. I don't know why but they always confused me.
Object.freeze(): It prevents you from adding new properties, removing existing properties and modifying them.
Object.seal(): You can modify existing properties but you can't delete or add new ones.
CRUD Operations
If we differentiate them through the CRUD operations: Create - Read - Update - Delete, we obtain the following comparison.
Create Read Update DeleteObject.freeze() Object.seal()
The wonderful world of Javascript. That's all for today :)
Original Link: https://dev.to/antoomartini/differences-between-object-freeze-and-object-seal-in-javascript-n11
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To