Skip to content

Commit 75939fe

Browse files
hemangtksumn2u
authored andcommitted
added hyperlink to function and block scope
1 parent d87a746 commit 75939fe

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

en/interview-questions/basic-level.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ sendMessage2(); // Returns “Hello world”
226226

227227
**[Function Scope](#function-scope)**:
228228
<a name="function-scope"></a>
229+
### Function Scope
229230
Any variables or functions declared inside a function have `local/function scope`, which means that all the variables and functions declared inside a function, can be accessed from within the function and not outside of it.
230231

231232
```js
@@ -243,6 +244,7 @@ multiplyBy2(); // Throws reference error since multiplyBy2 is written in local s
243244

244245
**[Block Scope](#block-scope)**:
245246
<a name="block-scope"></a>
247+
### Block Scope
246248
`Block scope` is related to the variables declared using let and const. Variables declared with var do not have block scope. Block scope tells us that any variable declared inside a block `{ }`, can be accessed only inside that block and cannot be accessed outside of it.
247249

248250
```js

0 commit comments

Comments
 (0)