Skip to content

Commit 0574c9c

Browse files
authored
Merge pull request #413 from ameltonyan/fix/412
A new way of creating an already existing variable in the surrounding scope. #412
2 parents c05e020 + 18991ca commit 0574c9c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: docs/let.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ if (true) {
5757
var foo = 123;
5858
}
5959
```
60-
However if the variable name is already taken by the surrounding scope then a new variable name is generated as shown (notice `_foo`):
60+
However if the variable name is already taken by the surrounding scope then a new variable name is generated as shown (notice `foo_1`):
6161

6262
```ts
6363
var foo = '123';
@@ -69,12 +69,12 @@ if (true) {
6969

7070
var foo = '123';
7171
if (true) {
72-
var _foo = 123; // Renamed
72+
var foo_1 = 123; // Renamed
7373
}
7474
```
7575

7676
#### Switch
77-
You can wrap your `case` bodies in `{}` to reuse variable names reliably in different `case` statement as shown below:
77+
You can wrap your `case` bodies in `{}` to reuse variable names reliably in different `case` statement as shown below:
7878

7979
```ts
8080
switch (name) {

0 commit comments

Comments
 (0)