Congelar objetos con javascript para evitar la mutación ['ESP','ENG']

in StemSocial5 months ago

En javascript se puede utilizar métodos de los objetos para realizar ciertas mutaciones una de las ventajas que tiene javascript es que los valores internos de los objetos puede ser fácilmente editables pero en algunos casos no deseamos que se usan ese tipo de cosas por suerte existe un método nativo de objetos para congelarlos.

In javascript you can use object methods to perform certain mutations. One of the advantages that javascript has is that the internal values ​​of the objects can be easily edited, but in some cases we do not want that type of thing to be used, luckily there is a method native objects to freeze them.
Este método lo único que hace es congelar objeto de manera que no se puedan alterar ninguno de esos datos internos la única manera de volver a poder editar este este objeto es desde donde se creó inicialmente donde están sus valores primitivos o descongelando este objeto con el método asignar.
The only thing this method does is freeze the object so that none of that internal data can be altered. The only way to be able to edit this object again is from where it was initially created where its primitive values ​​are or by unfreezing this object with the method assign.
Sort:  

Nice blog, you must be pretty experience at this friend 🤔💯

I love be a developer and share My knowledge with others too

That's so thoughtful brother

Congratulations @dobro2020! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)

You distributed more than 20000 upvotes.
Your next target is to reach 21000 upvotes.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP