fix(curriculum): scoping variables language improvement (#42135)

This commit is contained in:
alirezaghey
2021-05-14 16:02:54 +00:00
committed by GitHub
parent 8a67ecf788
commit 79e799feb5

View File

@ -11,7 +11,7 @@ dashedName: global-scope-and-functions
In JavaScript, <dfn>scope</dfn> refers to the visibility of variables. Variables which are defined outside of a function block have <dfn>Global</dfn> scope. This means, they can be seen everywhere in your JavaScript code. In JavaScript, <dfn>scope</dfn> refers to the visibility of variables. Variables which are defined outside of a function block have <dfn>Global</dfn> scope. This means, they can be seen everywhere in your JavaScript code.
Variables which are used without the `var` keyword are automatically created in the `global` scope. This can create unintended consequences elsewhere in your code or when running a function again. You should always declare your variables with `var`. Variables which are declared without the `var` keyword are automatically created in the `global` scope. This can create unintended consequences elsewhere in your code or when running a function again. You should always declare your variables with `var`.
# --instructions-- # --instructions--