Learn JavaScript Variables In One Video! Learn JavaScript Variable Var, Let, and Const.

Опубликовано: 18 Август 2024
на канале: Tech With Saini
89
2

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.


На этой странице сайта вы можете посмотреть видео онлайн Learn JavaScript Variables In One Video! Learn JavaScript Variable Var, Let, and Const. длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Tech With Saini 18 Август 2024, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 89 раз и оно понравилось 2 зрителям. Приятного просмотра!