Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

- [DOM Events](./code-snippets/dom-events.md)
- [Hoisting](./code-snippets/hoisting.md)
- Scopes & Closures
- [Scopes & Closures](./code-snippets/scopes&closures.md)
- Functions
- Objects
- Error handling
Expand Down
37 changes: 37 additions & 0 deletions code-snippets/scopes&closures.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,42 @@ const func = foo(7);
</details>

</li>

---

<li>


**What will be the output ?**

```JS
const fn = () => {
a = 2;
console.log(a);
}

fn();


```

- A: `undefined`
- B: `2`
- C: `Uncaught ReferenceError: a is not defined`

<br/>

<details>
<summary><b>Answer</b></summary>
<p>

#### Option: B

</p>
</details>


</li>

</ol>