let, var, const
Some what correct. Will discuss more while
assigning objects to variables
Memory
10020
10022
10024 ?
10026 2000
10028
10030
10032
10034
10036
10038
10040
10042
10044 3000
const
• Variables declared using const
cannot be reassigned.
• They are called constants
• Used to avoid mistakes
• It is a best practice to write
constants in UPPER CASE
var
• Variables declared with var can be
redeclared
• var is the only keyword used to
create variables till 2015
• let and const were introduced in ES6
(ECMAScript 2015)
var let const
Variables declared with Variables declared with let Variables declared with
var can be re-assigned and can be re-assigned but const cannot be re-
re-declared within the cannot be re-declared in assigned or re-declared.
same scope the same scope But…
It is recommended to Preferred for variables Best for variables that
avoid using var in modern that may need to change should not be reassigned.
JavaScript. value To avoid mistakes.
Will discuss after talking about
scopes and hoisting
Some what correct. Will discuss more while
assigning objects to variables
Memory
10020
10022
10024 ?
10026 2000
10028
10030
10032
10034
10036
10038
10040
10042
10044 3000
8 Data Types
Primitive Data Types Non - Primitive Data Types
1. number 1. object
2. string
3. boolean
4. null
5. undefined Will discuss more
6. bigint about it later
7. symbol
Chapter 15
statements