You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 5, 2021. It is now read-only.
We've been using let for declaring variables almost everywhere. This is a good thing, as it is better-behaved than var (yay for block-scoping!).
But ES6 / TypeScript actually comes with const keyword. As a general rule, we should use it whenever possible, that is, whenever the variable identifier isn't meant to be reassigned.
Rationale: It will make variable identifiers that are meant to be reassigned easier to locate, and will reduce the likelihood of accidental reassignements.
The const declaration creates a read-only reference to a value. It does not mean the value it holds is immutable, just that the variable identifier cannot be reassigned.
Doing this in the whole codebase all at once might be a pain, so feel free to submit a pull request that just takes care of a file or two. Over time, we'll get there.
The text was updated successfully, but these errors were encountered:
We've been using
let
for declaring variables almost everywhere. This is a good thing, as it is better-behaved thanvar
(yay for block-scoping!).But ES6 / TypeScript actually comes with
const
keyword. As a general rule, we should use it whenever possible, that is, whenever the variable identifier isn't meant to be reassigned.Rationale: It will make variable identifiers that are meant to be reassigned easier to locate, and will reduce the likelihood of accidental reassignements.
Doing this in the whole codebase all at once might be a pain, so feel free to submit a pull request that just takes care of a file or two. Over time, we'll get there.
The text was updated successfully, but these errors were encountered: