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
Copy file name to clipboardExpand all lines: docs/let.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -108,7 +108,7 @@ for (var j = 0; j < 3; j++) {
108
108
funcs[j]();
109
109
}
110
110
```
111
-
Here the functions close over (hence called a `closure`) the *local* variable (conviniently named `local`) and use that instead of the loop variable `i`. Note that closures come with a performance impact (they need to store the surrounding state) and therefore even though the ES6 `let` keyword in a loop would have the same behavior as the previous example, the following is an error in TypeScript if you target something less that ES6:
111
+
Here the functions close over (hence called a `closure`) the *local* variable (conveniently named `local`) and use that instead of the loop variable `i`. Note that closures come with a performance impact (they need to store the surrounding state) and therefore even though the ES6 `let` keyword in a loop would have the same behavior as the previous example, the following is an error in TypeScript if you target something less than ES6:
112
112
113
113
```ts
114
114
var funcs = [];
@@ -133,4 +133,4 @@ Despite a few limitations, we find `let` to be extremely useful to have for the
0 commit comments