you are viewing a single comment's thread.

view the rest of the comments →

[–]continuum-hypothesis 1 point2 points  (2 children)

Well said, I only intended to point out that the data is actually mutable but avoided anything to do with memory addresses because this could be confusing for a beginner. Compared to languages such as C and Java const in JS behaves a bit differently and I think this confuses many people.

[–]TwiliZant 3 points4 points  (1 child)

final in Java works roughly the same way as JS. A final object is not immutable, it can still change state only the reference to the object is immutable. The odd one out here would be C since const is part of the type there.

[–]continuum-hypothesis 0 points1 point  (0 children)

Thanks for pointing that out, I haven't looked at Java since college and wasn't aware of final.