|
|
|
|
|
by MobiusHorizons
203 days ago
|
|
I get why we prefer final in languages with a need for thread safety, but I have never understood why people prefer const in typescript. I have seen people bend over backwards to avoid a `let` even if it results in higher complexity code. It just doesn’t seem to solve a problem I’ve ever actually encountered in typescript code. |
|
If you aren't going to be doing that, using const lets the reader know the assignment won't change to refer to a new value.
It's that simple.