Using JavaScript ES6, I am surprised that doing:
const a = {};
a.foo = 'bar';
a.foo = 'car';
Is valid. Why is this? I would have assumed const
would mean you cannot change the a
empty object and apply new properties. Even further, I would also have assumed you cannot change the value of a property of a
once it is set.