|
|
|
|
|
by denton-scratch
1866 days ago
|
|
Let is syntactic sugar. To me, the code smell is the syntax from BASIC (and later C) that goes: <code>
x = y
</code> I've always disliked that notation; it looks like the statement "the value of x is the same as the value of y". So "let" turns the code into something that makes sense when read aloud. I don't think syntactic sugar is a code smell. |
|
let isn't syntactic sugar — it's the only way to declare a reassignable block-scoped variable (as opposed to const, which can't be reassigned, and var, which is function-scoped or globally-scoped).