Skip to content

Commit ed92473

Browse files
committed
exec: explain-the-concept-of-lexical-scoping
1 parent 208848a commit ed92473

File tree

1 file changed

+3
-3
lines changed
  • questions/explain-the-concept-of-lexical-scoping

1 file changed

+3
-3
lines changed

questions/explain-the-concept-of-lexical-scoping/en-US.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ title: Explain the concept of lexical scoping
66

77
Lexical scoping means that the scope of a variable is determined by its location within the source code, and nested functions have access to variables declared in their outer scope. For example:
88

9-
```js
9+
```js live
1010
function outerFunction() {
1111
let outerVariable = 'I am outside!';
1212

@@ -36,7 +36,7 @@ When a function is defined, it captures the scope in which it was created. This
3636

3737
Consider the following example:
3838

39-
```js
39+
```js live
4040
function outerFunction() {
4141
let outerVariable = 'I am outside!';
4242

@@ -60,7 +60,7 @@ In this example:
6060

6161
Lexical scoping is closely related to closures. A closure is created when a function retains access to its lexical scope, even when the function is executed outside that scope.
6262

63-
```js
63+
```js live
6464
function outerFunction() {
6565
let outerVariable = 'I am outside!';
6666

0 commit comments

Comments
 (0)