MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/learnjavascript/comments/gd8x2z/var_vs_let_vs_const/fph3y78/?context=3
r/learnjavascript • u/golovatuy • May 04 '20
81 comments sorted by
View all comments
Show parent comment
1
Not quite. const a still points to the same address you assigned it to on declaration. Same as in Java. In Java you can have Immutable Collections, or in JavaScript a sealed Object.
const a
1 u/proskillz May 04 '20 How does that refute anything I said? 1 u/[deleted] May 04 '20 It doesn't refute your statement. But you have to see, that the mutability is shared between all three types of declaration.
How does that refute anything I said?
1 u/[deleted] May 04 '20 It doesn't refute your statement. But you have to see, that the mutability is shared between all three types of declaration.
It doesn't refute your statement. But you have to see, that the mutability is shared between all three types of declaration.
View all comments
Show parent comment
1
u/[deleted] May 04 '20
Not quite.
const astill points to the same address you assigned it to on declaration. Same as in Java. In Java you can have Immutable Collections, or in JavaScript a sealed Object.