Variable Declaration ( Var - Let - Const ) | Javascript Learning

Publié le: 11 janvier 2023
sur la chaîne: Ride With Bankim
1,075
104

The var keyword is the oldest way of declaring variables in JavaScript and is supported by all browsers. The let and const keywords are newer additions to the language and are not supported by older browsers.

If you need to support older browsers, you can use var instead of let or const. If you don’t need to support older browsers, you can use let or const. If you want your variable to be immutable, use const.

So, to sum up, the main differences between var, let and const are:

1) var is function-scoped while let and const are block-scoped.
2) var variables can be reassigned while let and const variables can not.
3) var variables are declared using the var keyword while let and const variables are declared using the let and const keywords respectively.
4) const variables are immutable while let and var variables are not.

javascript variable declaration,javascript,javascript variables,javascript variables tutorial,javascript for beginners,ECMAScript,variables in javascript,javascript tutorial for beginners,es6,javascript variables explained,javascript programming,let vs const,var vs let,javascript var,var vs const,front end,web development,javascript variable types,let vs var vs const,var let const,javascript let,const,programming


Sur cette page du site, vous pouvez voir la vidéo en ligne Variable Declaration ( Var - Let - Const ) | Javascript Learning durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Ride With Bankim 11 janvier 2023, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 1,075 fois et il a aimé 104 téléspectateurs. Bon visionnage!