
Understanding Variables and Data Types in JavaScript
Think of variables as box that stores information,so it you multiple box then you need to label the box to understand what is stored inside. In programming varibale stores data and vairable name is label let name = "John"; Here name is label and John is value How to declare varaibles we can use let,var & const to declare variable let age = 25; const country = "USA" var isStudent=true Primitives data type String let name = "Alice"; number let age = 20; Boolean let isStudent = true; null let middleName = null; undefined let score; When to user var,let & const: var : declares function-scoped or globally-scoped variables let : declares a block-scoped variable const: declares a block-scoped variable, assigning a value that cannot be re-assigned. What is block-scope where Scope means where your variable is used. Think of variable as scope in your room: if you put your box in living room everyone can see it if you put your box in your bedroom only you can see it { let message = "Hello"; conso
Continue reading on Dev.to
Opens in a new tab

![[MM’s] Boot Notes — The Day Zero Blueprint — Test Smarter on Day One](/_next/image?url=https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1368%2F1*AvVpFzkFJBm-xns4niPLAA.png&w=1200&q=75)

