You can actually change the properties of an object.
I found this after some researching, modify it to your needs.
var data = { };
Object.defineProperty(data, 'secret', {
value: 42,
writable : false,
enumerable : true,
configurable : false
});
From @jAndy's answer:
That way, we created a property secret with the value
42
within data, which cannot get modfied nor deleted.The caveat here is, that the genius (like you called it) will also be able to spot this code and just modify that, to again be able to change the content if he wishes to. You just can't create a secured front-end JavaScript in that way. The code will always be available as plain-text for everybody.
Source: How to prevent the changing of a variable value in Javascript