Charlie Greenman
1 min readMar 5, 2019

--

Hello Torleif Berger first, and foremost, thank you for reading. The point you bring up is indeed very confusing. However, it is important to distinguish between “read-only” and “immutability”. In particular with regards to `const` in javascript, it is read-only reference, but like pointers in lower level languages in C, it can still be mutated. I created a stackoverflow that discusses this point in detail: https://stackoverflow.com/questions/54994582/why-are-constants-considered-as-mutable-in-javascript-when-only-partially-true/54994583#54994583

So yes, `consts` are indeed mutable.

--

--

Responses (1)