Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
EugeneOZ
· 11y ago · 0 comments
Ironically enough, but your example shows where const is shouldn't be used as guarantee of immutability:
https://t.co/JIQozGe7Md
Comments
[–]
agumonkey
11y ago
Isn't that a typical "corner case" in the understanding of dynamic languages bindings ? I think I've seen the same question pop about python. The array binding is constant, its content isn't.
[–]
EugeneOZ
OP
11y ago
if value of constant can be changed, it's not constant. In my understanding. And by Wikipedia:
http://en.wikipedia.org/wiki/Constant_(computer_programming)
[–]
agumonkey
11y ago
That's typical computer lingo / semantic issue. the `const` mean shallow/pointer constant, not deep/structurally constant.
[–]
bmeck
11y ago
const is not about immutability in JS.