- Популярные видео
- Авто
- Видео-блоги
- ДТП, аварии
- Для маленьких
- Еда, напитки
- Животные
- Закон и право
- Знаменитости
- Игры
- Искусство
- Комедии
- Красота, мода
- Кулинария, рецепты
- Люди
- Мото
- Музыка
- Мультфильмы
- Наука, технологии
- Новости
- Образование
- Политика
- Праздники
- Приколы
- Природа
- Происшествия
- Путешествия
- Развлечения
- Ржач
- Семья
- Сериалы
- Спорт
- Стиль жизни
- ТВ передачи
- Танцы
- Технологии
- Товары
- Ужасы
- Фильмы
- Шоу-бизнес
- Юмор
Hoisting and the temporal dead zone (JS's weirdest feature)
console.log a variable before you declare it. JavaScript should crash. But it doesn't. Why?
What's covered:
• console.log(x) on line 1, var x = 5 on line 2 → prints `undefined`, not an error.
• Hoisting: var and function declarations get moved to the top of their scope.
• Only the declaration is hoisted, not the assignment.
• let and const are also hoisted — but they sit in the 'temporal dead zone' until declared.
• Takeaway: use let and const, hoisting bugs disappear.
Save this. Then never use var again.
#pixelgridui #javascript #js #hoisting #webdev
Видео Hoisting and the temporal dead zone (JS's weirdest feature) канала Pixel Grid UI
What's covered:
• console.log(x) on line 1, var x = 5 on line 2 → prints `undefined`, not an error.
• Hoisting: var and function declarations get moved to the top of their scope.
• Only the declaration is hoisted, not the assignment.
• let and const are also hoisted — but they sit in the 'temporal dead zone' until declared.
• Takeaway: use let and const, hoisting bugs disappear.
Save this. Then never use var again.
#pixelgridui #javascript #js #hoisting #webdev
Видео Hoisting and the temporal dead zone (JS's weirdest feature) канала Pixel Grid UI
Комментарии отсутствуют
Информация о видео
30 мая 2026 г. 22:17:08
00:01:12
Другие видео канала





















