←back to thread

498 points azhenley | 1 comments | | HN request time: 0.301s | source
Show context
TheRoque ◴[] No.45772138[source]
I also default to const in javascript. Somehow a "let" variable feels so dirty, but I don't really know why. I guess at this point my experience forged an instinct but I can't even put a theory on it. But it's sometimes necessary and I use it of course.
replies(2): >>45772627 #>>45773213 #
1. catlifeonmars ◴[] No.45772627[source]
In JS, by using const, you are signalling to the reader that they don’t need to look out for a reassignment to understand the code. If you use let, you are saying the opposite.