DEV Community

Discussion on: `let` vs `const` and The Mental Mass of Functions

tobias_salzmann profile image
Tobias Salzmann • Edited on

Imho, re-assigning a let with an immutable value should be preferred over mutating a const value though.

katzy687 profile image
Natti Katz Author

that's a great point.

The method above is probably more useful with primitives.

In the case where I wanted to slice to a new array, or convert to an immutable data structure I would stick with let.

But the point remains that I wouldn't necessarily want to use let unless that I knew I was going to be doing some reassignment to preserve immutability.