Comment

Comment by wild_preference

This article has a lot to offer a JS + React beginner so it feels lame to reply to some tiny part of it, but this bit is a constant error propogated in the ecosystem:

> Even though it is possible to mutate the inner properties of objects and arrays when using const, the variable declaration shows the intent of keeping the variable immutable though.

let and const only control mutability of the reference. They say nothing of the value mutability. const then can only be a signal that you are not reassigning to the identifier.

const is still useful as a default of course since reassignment is generally the exception.

Maybe this is what they meant but the language used made it seem otherwise.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton