- Notifications
You must be signed in to change notification settings - Fork179
Variable scope, closure#219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
62 commits Select commitHold shift + click to select a range
0cc7335
1-04-03: Garbage collection part 1
dolgachio9becadb
1-04-03: Garbage Collection part 2
dolgachio6b2daeb
1-04-03: Garbage Collection part 3
dolgachio9ad7406
Update 1-js/04-object-basics/03-garbage-collection/article.md
tarasyyyk9ce1a95
Update 1-js/04-object-basics/03-garbage-collection/article.md
tarasyyykba980b7
Merge branch 'master' of github.com:javascript-tutorial/uk.javascript…
dolgachio74ad282
1-js/06-advanced-functions/03-closure: translate p. 1
dolgachio076b1da
Merge branch 'master' of github.com:stas-dolgachov/uk.javascript.info
dolgachio911cecd
1-js/06-advanced-functions/03-closure: translate p. 2
dolgachiocfdfb59
1-js/06-advanced-functions/03-closure: translate p. 3
dolgachio1faad9d
1-js/06-advanced-functions/03-closure: transkate tasks
dolgachio1304815
Merge branch 'javascript-tutorial:master' into master
dolgachio784d79b
Update 1-js/06-advanced-functions/03-closure/1-closure-latest-changes…
dolgachio742c311
Update 1-js/06-advanced-functions/03-closure/1-closure-latest-changes…
dolgachio7ba32b0
Update 1-js/06-advanced-functions/03-closure/10-make-army/_js.view/so…
dolgachio3ba3722
Update 1-js/06-advanced-functions/03-closure/article.md
dolgachio4212bd9
Update 1-js/06-advanced-functions/03-closure/3-counter-independent/so…
dolgachioc43b4b5
Update 1-js/06-advanced-functions/03-closure/10-make-army/_js.view/so…
dolgachioa21be02
Update 1-js/06-advanced-functions/03-closure/10-make-army/_js.view/so…
dolgachioe2e86d0
Update 1-js/06-advanced-functions/03-closure/article.md
dolgachiodd02f54
Update 1-js/06-advanced-functions/03-closure/article.md
dolgachiobf35432
Update 1-js/06-advanced-functions/03-closure/10-make-army/solution.md
dolgachioc721a91
Update 1-js/06-advanced-functions/03-closure/10-make-army/solution.md
dolgachiob7a7d7c
Update 1-js/06-advanced-functions/03-closure/10-make-army/solution.md
dolgachiod0f3a1e
Update 1-js/06-advanced-functions/03-closure/10-make-army/solution.md
dolgachio7c7fbe6
Update 1-js/06-advanced-functions/03-closure/10-make-army/task.md
dolgachioa10f53c
Update 1-js/06-advanced-functions/03-closure/2-closure-variable-acces…
dolgachiobdfe39b
Update 1-js/06-advanced-functions/03-closure/3-counter-independent/ta…
dolgachio871c5ad
Update 1-js/06-advanced-functions/03-closure/4-counter-object-indepen…
dolgachio6d5980f
Update 1-js/06-advanced-functions/03-closure/6-closure-sum/task.md
dolgachioa8cbf1a
Update 1-js/06-advanced-functions/03-closure/7-let-scope/solution.md
dolgachio5a6aa8b
Update 1-js/06-advanced-functions/03-closure/7-let-scope/solution.md
dolgachio65611e5
Update 1-js/06-advanced-functions/03-closure/7-let-scope/solution.md
dolgachio1c82c1b
Update 1-js/06-advanced-functions/03-closure/7-let-scope/solution.md
dolgachio9c34751
Update 1-js/06-advanced-functions/03-closure/7-let-scope/task.md
dolgachio9959f67
Update 1-js/06-advanced-functions/03-closure/8-filter-through-functio…
dolgachio8b187b5
Update 1-js/06-advanced-functions/03-closure/9-sort-by-field/task.md
dolgachio46e1841
Update 1-js/06-advanced-functions/03-closure/8-filter-through-functio…
dolgachio1f60cdb
Update 1-js/06-advanced-functions/03-closure/9-sort-by-field/_js.view…
dolgachio404e7c4
Update 1-js/06-advanced-functions/03-closure/9-sort-by-field/_js.view…
dolgachio143e355
Update 1-js/06-advanced-functions/03-closure/9-sort-by-field/_js.view…
dolgachio4fee958
Update 1-js/06-advanced-functions/03-closure/9-sort-by-field/_js.view…
dolgachiobb2fb19
Update 1-js/06-advanced-functions/03-closure/9-sort-by-field/task.md
dolgachio79a696e
Update 1-js/06-advanced-functions/03-closure/9-sort-by-field/task.md
dolgachio6c08021
Update 1-js/06-advanced-functions/03-closure/9-sort-by-field/task.md
dolgachio9dd0815
Update 1-js/06-advanced-functions/03-closure/article.md
dolgachio2b538a3
Update 1-js/06-advanced-functions/03-closure/article.md
dolgachio21082c9
Update 1-js/06-advanced-functions/03-closure/article.md
dolgachiob7dca2c
Update 1-js/06-advanced-functions/03-closure/article.md
dolgachio33edfa4
Update 1-js/06-advanced-functions/03-closure/article.md
dolgachio75abb03
Update 1-js/06-advanced-functions/03-closure/article.md
dolgachio2ab537c
Update 1-js/06-advanced-functions/03-closure/article.md
dolgachio2f864c6
Update 1-js/06-advanced-functions/03-closure/article.md
dolgachiof73e73b
Update 1-js/06-advanced-functions/03-closure/article.md
dolgachio3a76506
Update 1-js/06-advanced-functions/03-closure/article.md
dolgachio6335aa3
Update 1-js/06-advanced-functions/03-closure/article.md
dolgachio27db556
Revert image translation
dolgachio75d356c
Update 1-js/06-advanced-functions/03-closure/2-closure-variable-acces…
tarasyyyk1453e09
Update 1-js/06-advanced-functions/03-closure/2-closure-variable-acces…
tarasyyyk8db01eb
Update task.md
tarasyyyk7096c73
Update 1-js/06-advanced-functions/03-closure/2-closure-variable-acces…
tarasyyyk5ab27d4
Update solution.md
tarasyyykFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
6 changes: 3 additions & 3 deletions1-js/06-advanced-functions/03-closure/1-closure-latest-changes/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Відповідь: **Петро**. | ||
Функція отримує зовнішні змінні такими, якими вони є зараз, тобто вона використовує останні значення. | ||
Старі значення змінних ніде не зберігаються. Коли функція потребує змінної, вона бере поточне значення зі свого власного або зовнішнього лексичного середовища. |
16 changes: 8 additions & 8 deletions1-js/06-advanced-functions/03-closure/1-closure-latest-changes/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions1-js/06-advanced-functions/03-closure/10-make-army/_js.view/solution.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions1-js/06-advanced-functions/03-closure/10-make-army/_js.view/source.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions1-js/06-advanced-functions/03-closure/10-make-army/_js.view/test.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
56 changes: 28 additions & 28 deletions1-js/06-advanced-functions/03-closure/10-make-army/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
26 changes: 13 additions & 13 deletions1-js/06-advanced-functions/03-closure/10-make-army/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions1-js/06-advanced-functions/03-closure/2-closure-variable-access/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
Відповідь: **Петро**. | ||
Функція `work()`в коді нижче отримує`name`від місця його походження через посилання на зовнішнє лексичне середовище: | ||
 | ||
Отже, відповіддю буде `"Петро"`. | ||
Але якби не було`let name`у `makeWorker()`,тоді пошук вийшов би за межі лексичного середовища та взяв би глобальну змінну, як ми бачимо з ланцюжка вище. В такому випадку відповідь була б `"Іван"`. |
18 changes: 9 additions & 9 deletions1-js/06-advanced-functions/03-closure/2-closure-variable-access/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions1-js/06-advanced-functions/03-closure/3-counter-independent/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Відповідь: **0,1.** | ||
Функції `counter`і `counter2`створюються різними викликами `makeCounter`. | ||
Отже, вони мають незалежні зовнішні лексичні середовища, кожне з яких має свою власну змінну `count`. |
6 changes: 3 additions & 3 deletions1-js/06-advanced-functions/03-closure/3-counter-independent/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions1-js/06-advanced-functions/03-closure/4-counter-object-independent/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions1-js/06-advanced-functions/03-closure/4-counter-object-independent/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions1-js/06-advanced-functions/03-closure/5-function-in-if/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Результатом буде **помилка**. | ||
Функція`sayHi`оголошується всередині`if`,тому вона доступна тільки всередині нього. Зовні функції`sayHi`не існує. |
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.