|
|
|
|
|
by capableweb
1290 days ago
|
|
> Whether it's JavaScript's `const` const is JS is referring to the reference and has nothing to do with the value, it's not even shallow immutability, there is none at all. const arr = []
arr.push(1)
is valid JavaScript.Bit nitpicky maybe, but wouldn't want people to get the impression const gives you any sort of immutability. |
|
const makes the binding immutable but not the object. Object.freeze makes the object immutable but not it’s children.