I'm using a base custom object extended with prototype
function Person() {}
Person.prototype.Name = "";
Person.prototype.Lastname = "";
var NewPerson= new Person();
NewPerson.Name = "Nancy";
NewPerson.Lastname = "Drew"; //<--- right way
NewPerson.lastname = "Drew"; //<--- wrong property
I need to avoid to add new properties and methods in a defined object because it would generate silent errors and bugs.
I know that javascript has a terrible way to manage classes/objects, but there's a way to protect it?
I found freeze and seal but those prevent me from changing the values.