You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,8 @@
5
5
2.[What are the different datatypes in JavaScript?](#q2-what-are-the-different-datatypes-in-javascript-most-asked)
6
6
3.[What is Hoisting in JavaScript?](#q3-what-is-hoisting-in-javascript-most-asked)
7
7
4.[What is Temporal Dead Zone?](#q4-what-is-temporal-dead-zone)
8
-
5.[What are the differences between `let`, `var`, and `const`?](#q5-differences-between-let-var-and-const)
8
+
5.[What are the differences between `let`, `var`, and `const`?](#q5-what-are-the-differences-between-let-var-and-const)
9
+
9
10
10
11
11
12
### Q1. Is JavaScript a dynamically typed language or a statically typed language?
@@ -68,15 +69,16 @@ function somemethod() {
68
69
[Back to Top](#javascript-basics)
69
70
70
71
### Q5. What are the differences let, var and const ? (Most asked)
71
-
** Scope: **
72
+
73
+
**Scope:**
72
74
- Variables declared with var are function scoped.( available through out the function where its declared ) or global scoped( if defined outside the function ).
73
75
- Variables declared with let and const are block scoped.
74
-
**Reassignment:**
76
+
**Reassignment:**
75
77
- var and let can be reassigned.
76
78
- const cannot be reassigned.
77
-
**Hoisting:**
79
+
**Hoisting:**
78
80
- var gets hoisted and initialized with undefined.
79
81
- let and const - gets hoisted to the top of the scope but does not get assigned any value.(temporal dead zone)
0 commit comments