Javascript - How Hoisting Affects Variables and Functions

preview_player
Показать описание
declare and assign all local variables at the beginning of a function to prevent complications due to hoisting

hoisting happens when javascript automatically moves a variable declaration to the top of a function, but doesn't move the value assigned to it, so it defaults the value to undefined

the same rules apply with functions declared inside a function, depending on how they're defined

-----------------------------------------------------------

Рекомендации по теме
Комментарии
Автор

I really love the way your videos explain the harder JS concepts but just so simply - just included in there - if you get me.


You've a great command of JS & thank you for spending your time to help mee!!!! <3

LillyCode
Автор

Thank you for your SUPER, cohesive and explanatory tutorials.

I learnt a LOT & am already a developer.

I was getting confused with bloody functions & just did some research Have watched all your videos up to this one on functions (& will watch the rest) & just want to say really thanks.

Quick, simple but so so explanatory - you really explain things very well <3

LillyCode
visit shbcf.ru