From 9f099db565f8d1ca155829be538701bf7f867059 Mon Sep 17 00:00:00 2001 From: Muhammed Zakir <8190126+MuhammedZakir@users.noreply.github.com> Date: Thu, 10 Sep 2020 14:42:04 +0000 Subject: [PATCH] Update solution.md --- 1-js/06-advanced-functions/03-closure/10-make-army/solution.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/06-advanced-functions/03-closure/10-make-army/solution.md b/1-js/06-advanced-functions/03-closure/10-make-army/solution.md index 8b941c76..0e4b729f 100644 --- a/1-js/06-advanced-functions/03-closure/10-make-army/solution.md +++ b/1-js/06-advanced-functions/03-closure/10-make-army/solution.md @@ -51,7 +51,7 @@ function makeArmy() { } ``` - we can see that it lives in the lexical environment associated with the current `makeArmy()` run. But when `army[5]()` is called, `makeArmy` has already finished its job, and the final value of `i` is `10` (at the end of `while`). +We can see that it lives in the lexical environment associated with the current `makeArmy()` run. But when `army[5]()` is called, `makeArmy` has already finished its job, and the final value of `i` is `10` (at the end of `while`). As a result, all `shooter` functions get the same value from the outer lexical environment and that is, the last value, `i=10`.