maxehnert / deep-lockdown

Freeze and Seal Your Objects
MIT License
2 stars 0 forks source link

Object.seal and Object.preventExtensions are not needed. #1

Open abdulhannanali opened 7 years ago

abdulhannanali commented 7 years ago

I get what you wanted to do with deep-lockdown but just wanted to clarify that Object.seal and Object.preventExtensions are not needed to perform what is called a deep lockdown by you. Object.freeze automatically calls Object.seal and then modifies the writable property descriptor to be false for each property of the object

abdulhannanali commented 7 years ago

Read more here in the Immutability section of Ch3 This & Object Prototype (YDKJS) by Kyle Simpson