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

Publicado em: 11 Janeiro 2023
no canal de: 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


Nesta página do site você pode assistir ao vídeo on-line Variable Declaration ( Var - Let - Const ) | Javascript Learning duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Ride With Bankim 11 Janeiro 2023, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 1,075 vezes e gostou 104 espectadores. Boa visualização!