Learn JavaScript Variables In One Video! Learn JavaScript Variable Var, Let, and Const.
Variable Keywords:
var :
var x; //declaration
x = 10; // assignment
var y =20; // initialization
1. function scope. : you can declare variable using var anywhere in function
and access it from anywhere
2. it allows shadowing : re-declaring or re- initialization but not assignment.
var x;
x = 10;
var x =20;
3. it support hoisting. it tells the interpreter that i am here.
Let
: it defines the block. it will work in closure.
it doesnt support hoisting
it also dont support shadowing
it support declaration, assignment and initialization.
Const : it also defines block scope
it will not allow hoisting and shadowing.
it will allow declaring and assignment.
it supports only initialization.
En esta página del sitio puede ver el video en línea Learn JavaScript Variables In One Video! Learn JavaScript Variable Var, Let, and Const. de Duración hora minuto segunda en buena calidad , que subió el usuario Tech With Saini 18 agosto 2024, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 89 veces y le gustó 2 a los espectadores. Disfruta viendo!