File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff 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
6363var foo = ' 123' ;
@@ -69,12 +69,12 @@ if (true) {
6969
7070var foo = ' 123' ;
7171if (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
8080switch (name ) {
You can’t perform that action at this time.
0 commit comments