Hoisting
Hoisting
in JavaScript
instagram.com/codewithrafaqat/
youtube.com/codewithrafaqat/
Hoisting
Hoisting in JavaScript refers to the behavior
where variables and function declarations
are moved to the top of the containing
scope during the compilation phase, before
the code is executed.
01 Muhammad Rafaqat
React Developer
Variable Hoisting
Variable hoisting in JavaScript involves the
behavior where variable declarations (using
var) are moved to the top of their enclosing
function or global scope during the
compilation phase.
Using var:
02 Muhammad Rafaqat
React Developer
Using let and const:
03 Muhammad Rafaqat
React Developer
Function Hoisting
Function Declarations:
04 Muhammad Rafaqat
React Developer
Function Expressions:
05 Muhammad Rafaqat
React Developer
Did you find It
Useful?
Muhammad Rafaqat
@codewithrafaqat
instagram.com/codewithrafaqat/
youtube.com/codewithrafaqat/