r/javascript • u/kasperpeulen • Oct 24 '16
help The only thing I hate about const ...
... is that it is 5 chars long.
For some reason, let with its 3 chars, looks more elegant.
7
Upvotes
r/javascript • u/kasperpeulen • Oct 24 '16
... is that it is 5 chars long.
For some reason, let with its 3 chars, looks more elegant.
4
u/saadq_ Oct 24 '16 edited Oct 24 '16
Man, this sub is volatile, haha. I got a pretty negative reaction when I mentioned the same thing a few months ago.
I agree with you, especially in cases where you have a mix of const/let variable declarations like:
It would look neater if you used
leteverywhere (although of course you lose the added safety ofconst)Although I have seen a lot of people who do use
leteverywhere, and only useconstfor imports and for the old way of declaring "constants":I know Mozilla does it that way ^