Part-5 | 05 - Javascript Variables Exercise Start | Complete Course for Web Development |

Опубликовано: 11 Июль 2026
на канале: Learningvio
No
0

JavaScript variables are used to store values. You can think of a variable as a container that holds a value. The value that a variable holds can be a number, a string, an object, or a boolean, among other types.

To declare a variable in JavaScript, you use the var, let, or const keyword, followed by the name of the variable you want to create, like this:

Here, x, y, and z are the names of the variables. These are called the variable names or identifiers.

The difference between var, let and const is the scope of the variable.

var - is scoped to the nearest function block or, if not inside a function, to the global scope.
let - is scoped to the nearest enclosing block, which can be smaller than the function block.
const - is scoped similar to let, but you cannot reassign a new value to it. It is used when you want to make sure a variable will never change.
When you declare a variable without assigning any value to it, it is undefined. You can also assign a value to a variable when you declare it, like this:

Try creating some variables of your own and assign different types of value to it. Let me know if you have any questions or need further assistance.


#webdevelopmentfullcourse #css #java #programming #html ,"#java ,#python , #css ++ , #android ,#django ,#react , #datastructures ","#object -oriented #programming ", #algorithms ,"#debugging ","#performance -#optimization ,"#software #design ,#beginners ","#intermediate ","#advanced "