- Notifications
You must be signed in to change notification settings - Fork230
Variable scope#178
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
EzequielCaste merged 8 commits intojavascript-tutorial:masterfromvplentinax:variable-scopeJun 22, 2020
Uh oh!
There was an error while loading.Please reload this page.
Merged
Variable scope#178
Changes fromall commits
Commits
Show all changes
8 commits Select commitHold shift + click to select a range
c4a2fc1
variable-scope
vplentinax4170cb6
Merge branch 'master' into variable-scope
vplentinax72947cc
Update 1-js/06-advanced-functions/03-closure/2-closure-variable-acces…
EzequielCasteb96f5ed
Update 1-js/06-advanced-functions/03-closure/6-closure-sum/task.md
EzequielCaste1c85805
Update 1-js/06-advanced-functions/03-closure/8-filter-through-functio…
EzequielCaste6b07130
Update 1-js/06-advanced-functions/03-closure/article.md
EzequielCaste625f899
Update 1-js/06-advanced-functions/03-closure/article.md
EzequielCaste84ff7f2
Update 1-js/06-advanced-functions/03-closure/6-closure-sum/task.md
EzequielCasteFile 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
7 changes: 4 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,6 @@ | ||
La respuesta es: **Pete**. | ||
Una función obtiene variables externas con su estado actual, y utiliza los valores más recientes. | ||
Los valores de variables anteriores no se guardan en ningún lado. Cuando una función quiere una variable, toma el valor actual de su propio entorno léxico o el externo. | ||
11 changes: 6 additions & 5 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
48 changes: 25 additions & 23 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
16 changes: 8 additions & 8 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
10 changes: 6 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,11 @@ | ||
La respuesta es: **Pete**. | ||
La función `work()` en el código a continuación obtiene `name` del lugar de su origen a través de la referencia del entorno léxico externo: | ||
 | ||
Entonces, el resultado es "Pete". | ||
Pero si no hubiera `let name` en` makeWorker () `, entonces la búsqueda saldría y tomaría la variable global como podemos ver en la cadena de arriba. En ese caso, el resultado sería `John`. | ||
14 changes: 7 additions & 7 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
8 changes: 5 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,7 @@ | ||
La respuesta: **0,1.** | ||
Las funciones `counter` y` counter2` son creadas por diferentes invocaciones de `makeCounter`. | ||
Por lo tanto, tienen entornos léxicos externos independientes, cada uno tiene su propio `count`. | ||
7 changes: 4 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
6 changes: 3 additions & 3 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
8 changes: 4 additions & 4 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
6 changes: 4 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,5 @@ | ||
El resultado es **un error**. | ||
La función `sayHi` se declara dentro de `if`, por lo que solo vive dentro de ella. No hay `sayHi` afuera. | ||
4 changes: 2 additions & 2 deletions1-js/06-advanced-functions/03-closure/5-function-in-if/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#Función en if | ||
Mira el código ¿Cuál será el resultado de la llamada en la última línea? | ||
```js run | ||
let phrase = "Hello"; | ||
7 changes: 3 additions & 4 deletions1-js/06-advanced-functions/03-closure/6-closure-sum/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
10 changes: 5 additions & 5 deletions1-js/06-advanced-functions/03-closure/6-closure-sum/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
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.