Skip to content

Commit

Permalink
Updated variable declaration to remove ambiguity (mbeaudru#124)
Browse files Browse the repository at this point in the history
The current wording suggested that variables should be declared with const and then again with let when it is time to reassign them.
  • Loading branch information
haider-ilahi authored and mbeaudru committed Nov 17, 2019
1 parent 789167c commit d07e4cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ In JavaScript, there are three keywords available to declare a variable, and eac

Variables declared with ```const``` keyword can't be reassigned, while ```let``` and ```var``` can.

I recommend always declaring your variables with ```const``` by default, and with ```let``` if you need to *mutate* it or reassign it later.
I recommend always declaring your variables with ```const``` by default, but with ```let``` if it is a variable that you need to *mutate* or reassign later.

<table>
<tr>
Expand Down

0 comments on commit d07e4cd

Please sign in to comment.