Skip to content

Commit e9b20c2

Browse files
hemangtksumn2u
authored andcommitted
made the changes required
1 parent e51d9a8 commit e9b20c2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

en/interview-questions/basic-level.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ There are three types of scopes in JS:
207207
- [Local or Function Scope](#function-scope)
208208
- [Block Scope](#block-scope)
209209

210-
<a name="global-scope"></a>
210+
<a id="global-scope"></a>
211211
**Global Scope**: Variables or functions declared in the global namespace have global scope, which means all the variables and functions having global scope can be accessed from anywhere inside the code.
212212

213213
```js
@@ -222,7 +222,7 @@ function sendMessage2() {
222222
sendMessage2(); // Returns “Hello world”
223223
```
224224

225-
<a name="function-scope"></a>
225+
<a id="function-scope"></a>
226226
**Function Scope**: 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.
227227

228228
```js
@@ -238,7 +238,7 @@ console.log(a); // Throws reference error since a is written in local scope and
238238
multiplyBy2(); // Throws reference error since multiplyBy2 is written in local scope
239239
```
240240

241-
<a name="block-scope"></a>
241+
<a id="block-scope"></a>
242242
**Block Scope**: `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.
243243

244244
```js

0 commit comments

Comments
 (0)