1
I have an object and would like to prevent certain properties from being modified or removed. The code below is to illustrate:
var pessoa = {
nome: 'Fulano de Tal',
doc: '999.999.999-99'
};
console.log(pessoa);
pessoa.doc = '111.111.111-11'; // Modifica
console.log(pessoa);
delete pessoa.doc; // Remove
console.log(pessoa);
It is possible to prevent these actions ?