Consider the following JavaScript code:
const myObject = {
innerValue: 'test'
}
myObject.innerValue = 'I can still change this, this is not a constant';
If I run this code, the browser outputs no errors, I presume, because only the outer object myObject
is a constant and its properties are not. But how valid is this JavaScript code? I mean, are there any negative drawbacks to writing something like this?