Why does this code error:
const obj = {
one: 1,
two: 2
}
obj = {
one: 11,
two: 22
}
But this code works:
const obj = {
one: 1,
two: 2
}
obj.one = 33
console.log(obj);
What does the following sentence mean?
though a
const
binding to an object can itself not be changed and will continue to point at the same object, the contents of that object might change.