๐ ๐ฎ๐๐๐ฒ๐ฟ ๐ฃ๐ผ๐๐ฒ๐ฟ ๐๐ ๐ณ๐ผ๐ฟ ๐๐ฅ๐๐! ๐ฅ
Learn Power BI through these FREE learning resources
โ
โจ What You'll Learn:
๐ Interactive Dashboards
๐ Data Visualization
๐งน Data Transformation
๐ผ Real-World Reporting Skills
๐ฏ Beginner-Friendly โ No Coding Required
๐ฆ๐๐ฎ๐ฟ๐ ๐๐ฒ๐ฎ๐ฟ๐ป๐ถ๐ป๐ด ๐ณ๐ผ๐ฟ ๐๐ฅ๐๐
โ
โhttps://pdlink.in/4hznwlu
๐ซPerfect for Students โข Freshers โข Data Analyst Aspirants โข Working Professionals
Learn Power BI through these FREE learning resources
โ
โจ What You'll Learn:
๐ Interactive Dashboards
๐ Data Visualization
๐งน Data Transformation
๐ผ Real-World Reporting Skills
๐ฏ Beginner-Friendly โ No Coding Required
๐ฆ๐๐ฎ๐ฟ๐ ๐๐ฒ๐ฎ๐ฟ๐ป๐ถ๐ป๐ด ๐ณ๐ผ๐ฟ ๐๐ฅ๐๐
โ
โhttps://pdlink.in/4hznwlu
๐ซPerfect for Students โข Freshers โข Data Analyst Aspirants โข Working Professionals
โค4
๐๐ฃ๐ฎ๐ ๐๐ณ๐๐ฒ๐ฟ ๐ฃ๐น๐ฎ๐ฐ๐ฒ๐บ๐ฒ๐ป๐ ๐ง๐ฟ๐ฎ๐ถ๐ป๐ถ๐ป๐ด | ๐๐ฒ๐ฐ๐ผ๐บ๐ฒ ๐ฎ ๐๐๐น๐น๐๐๐ฎ๐ฐ๐ธ ๐๐ฒ๐๐ฒ๐น๐ผ๐ฝ๐ฒ๐ฟ ๐ช๐๐๐ต ๐๐ฒ๐ป๐๐
Start a high-paying tech careerโeven without prior coding experience
๐ ๐ฃ๐น๐ฎ๐ฐ๐ฒ๐บ๐ฒ๐ป๐ ๐๐ถ๐ด๐ต๐น๐ถ๐ด๐ต๐๐:
๐ฐ โน41 LPA highest salary
๐ โน7.4 LPA average salary
๐ 2,000+ students placed
๐ข 500+ hiring partners
โ 100% job assistance
๐ Skill Indiaโauthenticated certificate
๐ ๐๐ฝ๐ฝ๐น๐ ๐ก๐ผ๐๐:-
https://pdlink.in/3SuUeuD
๐ฏ HurryUp.....Limited Seats Available
Start a high-paying tech careerโeven without prior coding experience
๐ ๐ฃ๐น๐ฎ๐ฐ๐ฒ๐บ๐ฒ๐ป๐ ๐๐ถ๐ด๐ต๐น๐ถ๐ด๐ต๐๐:
๐ฐ โน41 LPA highest salary
๐ โน7.4 LPA average salary
๐ 2,000+ students placed
๐ข 500+ hiring partners
โ 100% job assistance
๐ Skill Indiaโauthenticated certificate
๐ ๐๐ฝ๐ฝ๐น๐ ๐ก๐ผ๐๐:-
https://pdlink.in/3SuUeuD
๐ฏ HurryUp.....Limited Seats Available
โค1
๐ ๐ ๐ถ๐ฐ๐ฟ๐ผ๐๐ผ๐ณ๐ ๐๐ฅ๐๐ ๐๐ผ๐๐ฟ๐๐ฒ๐ ๐๐ถ๐๐ต ๐๐ฒ๐ฟ๐๐ถ๐ณ๐ถ๐ฐ๐ฎ๐๐ฒ๐! ๐๐ฅ
Upgrade your resume with Microsoft learning opportunities. Explore courses covering some of today's most in-demand tech skills!
๐ฏ Perfect for Students โข Freshers โข Job Seekers โข Working Professionals
โ Learn at your own pace โ Build career-relevant skills โ Explore available certificates and credentials
๐ ๐๐ฐ๐ฐ๐ฒ๐๐ ๐ ๐ถ๐ฐ๐ฟ๐ผ๐๐ผ๐ณ๐ ๐๐ผ๐๐ฟ๐๐ฒ๐ ๐๐ฒ๐ฟ๐ฒ ๐
https://pdlink.in/3Uf5trR
๐ฅ Share with friends looking to upskill in 2026!
Upgrade your resume with Microsoft learning opportunities. Explore courses covering some of today's most in-demand tech skills!
๐ฏ Perfect for Students โข Freshers โข Job Seekers โข Working Professionals
โ Learn at your own pace โ Build career-relevant skills โ Explore available certificates and credentials
๐ ๐๐ฐ๐ฐ๐ฒ๐๐ ๐ ๐ถ๐ฐ๐ฟ๐ผ๐๐ผ๐ณ๐ ๐๐ผ๐๐ฟ๐๐ฒ๐ ๐๐ฒ๐ฟ๐ฒ ๐
https://pdlink.in/3Uf5trR
๐ฅ Share with friends looking to upskill in 2026!
โค1
๐ฎ๐ณ ๐๐ข๐ฉ๐๐ฅ๐ก๐ ๐๐ก๐ง ๐ข๐ ๐๐ก๐๐๐ โ ๐๐๐๐ง๐ ๐๐ก๐ง๐๐ฅ๐ก๐ฆ๐๐๐ฃ๐ฆ ๐ฎ๐ฌ๐ฎ๐ฒ ๐
Students and freshers can explore internship opportunities through the AICTE Internship Portal across multiple domains:
๐ป AI, Data Science & Web Development
๐ Digital Marketing & Business Development
๐ฐ Finance & Accounting
โ๏ธ Content Writing & Graphic Design
โ๏ธ Mechanical, Civil & Electrical Engineering
๐ ๐๐ต๐ฒ๐ฐ๐ธ ๐ข๐ฝ๐ฝ๐ผ๐ฟ๐๐๐ป๐ถ๐๐ถ๐ฒ๐ & ๐๐ฝ๐ฝ๐น๐ ๐
https://pdlink.in/4y3vcBl
๐ข Share this opportunity with your friends and classmates!
Students and freshers can explore internship opportunities through the AICTE Internship Portal across multiple domains:
๐ป AI, Data Science & Web Development
๐ Digital Marketing & Business Development
๐ฐ Finance & Accounting
โ๏ธ Content Writing & Graphic Design
โ๏ธ Mechanical, Civil & Electrical Engineering
๐ ๐๐ต๐ฒ๐ฐ๐ธ ๐ข๐ฝ๐ฝ๐ผ๐ฟ๐๐๐ป๐ถ๐๐ถ๐ฒ๐ & ๐๐ฝ๐ฝ๐น๐ ๐
https://pdlink.in/4y3vcBl
๐ข Share this opportunity with your friends and classmates!
โค3๐2
๐ ๐ช๐ต๐ถ๐ฐ๐ต ๐ง๐ฒ๐ฐ๐ต ๐ฆ๐ธ๐ถ๐น๐น ๐ช๐ถ๐น๐น ๐ฌ๐ผ๐ ๐ ๐ฎ๐๐๐ฒ๐ฟ ๐ถ๐ป ๐ฎ๐ฌ๐ฎ๐ฒ?
Want to build apps, uncover insights, or create AI solutions? Explore certification courses that match your career goals! ๐ฏ
๐ป ๐๐๐น๐น ๐ฆ๐๐ฎ๐ฐ๐ธ ๐๐ฒ๐๐ฒ๐น๐ผ๐ฝ๐บ๐ฒ๐ป๐
๐ https://pdlink.in/3SuUeuD
๐ ๐๐ฎ๐๐ฎ ๐๐ป๐ฎ๐น๐๐๐ถ๐ฐ๐
๐ https://pdlink.in/45vk5ph
๐ซ๐๐ ๐๐ป๐ด๐ถ๐ป๐ฒ๐ฒ๐ฟ๐ถ๐ป๐ด
๐ https://pdlink.in/4fWJVID
๐ฅ Choose your path, sharpen your skills, and take the next step towards your tech career!
๐ Save this post & share it with a friend planning to upskill.
Want to build apps, uncover insights, or create AI solutions? Explore certification courses that match your career goals! ๐ฏ
๐ป ๐๐๐น๐น ๐ฆ๐๐ฎ๐ฐ๐ธ ๐๐ฒ๐๐ฒ๐น๐ผ๐ฝ๐บ๐ฒ๐ป๐
๐ https://pdlink.in/3SuUeuD
๐ ๐๐ฎ๐๐ฎ ๐๐ป๐ฎ๐น๐๐๐ถ๐ฐ๐
๐ https://pdlink.in/45vk5ph
๐ซ๐๐ ๐๐ป๐ด๐ถ๐ป๐ฒ๐ฒ๐ฟ๐ถ๐ป๐ด
๐ https://pdlink.in/4fWJVID
๐ฅ Choose your path, sharpen your skills, and take the next step towards your tech career!
๐ Save this post & share it with a friend planning to upskill.
โค1
๐ป JavaScript Roadmap 2026 โ Part 9
๐ก Scope, Hoisting & Execution Context
Now we're moving from basic JavaScript syntax into concepts that explain how JavaScript actually executes your code.
These concepts are extremely important because they explain things like:
โข Why some variables are accessible in certain places but not others
โข Why functions can sometimes be called before they are written
โข Why "let" and "const" behave differently from "var"
โข How JavaScript manages function calls
โข How nested functions access variables from outer functions
1๏ธโฃ What Is Scope?
Scope determines where a variable can be accessed in your program.
For example:
The variable "name" is accessible here because it was declared in the outer scope.
But:
"message" is available inside "greet()".
Trying to access it outside:
causes an error because "message" belongs to the function's local scope.
2๏ธโฃ Global Scope
A variable declared outside functions and blocks is generally in the global/module scope depending on how your JavaScript is executed.
Example:
Output:
The function can access "appName" because the variable exists in an outer scope.
3๏ธโฃ Function Scope
Variables declared inside a function are accessible within that function.
This works.
But:
doesn't work because "price" exists only inside "calculate()".
4๏ธโฃ Block Scope
A block is code surrounded by "{}".
For example:
"message" exists inside that block.
But:
causes an error.
Variables declared using:
โข let
โข const
are block-scoped.
5๏ธโฃ "var" and Block Scope
This is one reason "var" can cause confusing behavior.
This can print:
because "var" is not block-scoped.
Compare:
This causes an error because "let" is block-scoped.
Remember:
โข var โ function-scoped
โข let โ block-scoped
โข const โ block-scoped
6๏ธโฃ Lexical Scope
JavaScript uses lexical scoping.
This means the scope of a variable is determined by where the code is written, not where the function is eventually called.
Example:
"inner()" can access "name" because "name" exists in an outer lexical scope.
7๏ธโฃ Scope Chain
What happens if JavaScript can't find a variable in the current scope?
It looks outward.
Example:
๐ก Scope, Hoisting & Execution Context
Now we're moving from basic JavaScript syntax into concepts that explain how JavaScript actually executes your code.
These concepts are extremely important because they explain things like:
โข Why some variables are accessible in certain places but not others
โข Why functions can sometimes be called before they are written
โข Why "let" and "const" behave differently from "var"
โข How JavaScript manages function calls
โข How nested functions access variables from outer functions
1๏ธโฃ What Is Scope?
Scope determines where a variable can be accessed in your program.
For example:
let name = "Rahul";
console.log(name);
The variable "name" is accessible here because it was declared in the outer scope.
But:
function greet() {
let message = "Hello";
console.log(message);
}
greet();"message" is available inside "greet()".
Trying to access it outside:
console.log(message);
causes an error because "message" belongs to the function's local scope.
2๏ธโฃ Global Scope
A variable declared outside functions and blocks is generally in the global/module scope depending on how your JavaScript is executed.
Example:
const appName = "My App";
function showAppName() {
console.log(appName);
}
showAppName();
Output:
My App
The function can access "appName" because the variable exists in an outer scope.
3๏ธโฃ Function Scope
Variables declared inside a function are accessible within that function.
function calculate() {
const price = 1000;
console.log(price);
}
calculate();This works.
But:
console.log(price);
doesn't work because "price" exists only inside "calculate()".
4๏ธโฃ Block Scope
A block is code surrounded by "{}".
For example:
if (true) {
let message = "Hello";
console.log(message);
}"message" exists inside that block.
But:
console.log(message);
causes an error.
Variables declared using:
โข let
โข const
are block-scoped.
5๏ธโฃ "var" and Block Scope
This is one reason "var" can cause confusing behavior.
if (true) {
var message = "Hello";
}
console.log(message);This can print:
Hello
because "var" is not block-scoped.
Compare:
if (true) {
let message = "Hello";
}
console.log(message);This causes an error because "let" is block-scoped.
Remember:
โข var โ function-scoped
โข let โ block-scoped
โข const โ block-scoped
6๏ธโฃ Lexical Scope
JavaScript uses lexical scoping.
This means the scope of a variable is determined by where the code is written, not where the function is eventually called.
Example:
const name = "Rahul";
function outer() {
function inner() {
console.log(name);
}
inner();
}
outer();
"inner()" can access "name" because "name" exists in an outer lexical scope.
7๏ธโฃ Scope Chain
What happens if JavaScript can't find a variable in the current scope?
It looks outward.
Example:
const country = "India";
function outer() {
const city = "Pune";
function inner() {
const name = "Rahul";
console.log(name);
console.log(city);
console.log(country);
}
inner();
}
outer();
โค1
When "inner()" looks for:
it finds it in its own scope.
For:
JavaScript looks in the outer scope.
For:
it goes one level further outward.
Conceptually:
This is the scope chain.
8๏ธโฃ What Is Hoisting?
Hoisting describes how JavaScript's execution process makes certain declarations available before their position in the source code is reached.
But different declarations behave differently.
This is why you should avoid thinking of hoisting as simply:
"JavaScript moves all code to the top."
That's not an accurate mental model.
9๏ธโฃ Function Declaration Hoisting
Function declarations can be called before their declaration in the same scope.
Output:
The function declaration is available when execution begins.
๐ "var" Hoisting
Consider:
The result is:
Conceptually, you can think of the declaration being initialized early:
The important point is:
before normal execution reaches the assignment.
1๏ธโฃ1๏ธโฃ "let" and "const" Hoisting
Now consider:
This produces a
The same applies to:
Why?
"let" and "const" declarations are created during the setup phase, but they aren't initialized until execution reaches their declaration.
The period between entering the scope and initialization is called the:
Temporal Dead Zone (TDZ)
1๏ธโฃ2๏ธโฃ Temporal Dead Zone
Example:
The variable "name" exists in the scope, but accessing it before initialization causes an error.
Conceptually:
So:
is not equivalent to using "var".
1๏ธโฃ3๏ธโฃ Why "let" and "const" Are Safer
Compare:
Output:
versus:
Error:
The error makes the problem much easier to detect instead of silently giving you
1๏ธโฃ4๏ธโฃ Function Scope vs Block Scope Example
Consider:
This works because "b" is function-scoped.
But:
nameit finds it in its own scope.
For:
cityJavaScript looks in the outer scope.
For:
countryit goes one level further outward.
Conceptually:
inner scope
โ
outer scope
โ
global/module scope
This is the scope chain.
8๏ธโฃ What Is Hoisting?
Hoisting describes how JavaScript's execution process makes certain declarations available before their position in the source code is reached.
But different declarations behave differently.
This is why you should avoid thinking of hoisting as simply:
"JavaScript moves all code to the top."
That's not an accurate mental model.
9๏ธโฃ Function Declaration Hoisting
Function declarations can be called before their declaration in the same scope.
greet();
function greet() {
console.log("Hello");
}
Output:
Hello
The function declaration is available when execution begins.
๐ "var" Hoisting
Consider:
console.log(age);
var age = 25;
The result is:
undefined
Conceptually, you can think of the declaration being initialized early:
var age;
console.log(age);
age = 25;
The important point is:
var declaration โ initialized as undefinedbefore normal execution reaches the assignment.
1๏ธโฃ1๏ธโฃ "let" and "const" Hoisting
Now consider:
console.log(age);
let age = 25;
This produces a
ReferenceError.The same applies to:
console.log(age);
const age = 25;
Why?
"let" and "const" declarations are created during the setup phase, but they aren't initialized until execution reaches their declaration.
The period between entering the scope and initialization is called the:
Temporal Dead Zone (TDZ)
1๏ธโฃ2๏ธโฃ Temporal Dead Zone
Example:
{
console.log(name);
let name = "Rahul";
}The variable "name" exists in the scope, but accessing it before initialization causes an error.
Conceptually:
Block begins
โ
name exists but is uninitialized
โ
Temporal Dead Zone
โ
let name = "Rahul"
โ
name becomes initialized
So:
console.log(name);
let name = "Rahul";
is not equivalent to using "var".
1๏ธโฃ3๏ธโฃ Why "let" and "const" Are Safer
Compare:
console.log(value);
var value = 10;
Output:
undefined
versus:
console.log(value);
let value = 10;
Error:
ReferenceError
The error makes the problem much easier to detect instead of silently giving you
undefined.1๏ธโฃ4๏ธโฃ Function Scope vs Block Scope Example
Consider:
function test() {
if (true) {
let a = 10;
var b = 20;
}
console.log(b);
}
test();This works because "b" is function-scoped.
But:
function test() {
if (true) {
let a = 10;
}
console.log(a);
}doesn't work because "a" is block-scoped.
โญ 1๏ธโฃ5๏ธโฃ What Is an Execution Context?
When JavaScript runs code, it creates an execution context.
An execution context is the environment in which JavaScript evaluates and executes code.
At a high level, there are different kinds of execution contexts.
The most important ones initially are:
โข Global Execution Context: Created when your JavaScript program begins executing.
โข Function Execution Context: Created whenever a function is called.
For example:
Conceptually:
1๏ธโฃ6๏ธโฃ Creation Phase and Execution Phase
A simplified mental model is that JavaScript prepares an execution context before executing its statements.
During setup, JavaScript determines things such as:
โข Variable bindings
โข Function declarations
โข Lexical environments
Then JavaScript executes the code.
For example:
During the setup process, JavaScript prepares the relevant bindings.
Then execution proceeds through the statements.
This helps explain why function declarations and "var" behave differently from "let" and "const".
1๏ธโฃ7๏ธโฃ Execution Context Stack
JavaScript uses a call stack to keep track of active function execution.
Example:
The execution roughly looks like:
When "third()" finishes:
Then:
Then:
Eventually the stack becomes empty.
โญ 1๏ธโฃ8๏ธโฃ Call Stack
The call stack follows:
LIFO (Last In, First Out)
For:
The stack conceptually becomes:
1. Global
2. first()
3. second()
Then:
Global continues
Understanding the call stack becomes very important when we later study:
โข Callbacks
โข Asynchronous JavaScript
โข Promises
โข Event loop
โข Stack overflow
โญ 1๏ธโฃ9๏ธโฃ Scope vs Execution Context
These concepts are related but not identical.
โข Scope answers: "Where can this variable be accessed?"
โข Execution context answers more broadly: "What environment is JavaScript using while executing this code?"
For example:
Scope determines which variables are accessible.
Execution context represents the environment created when "greet()" is actually executed.
โญ 2๏ธโฃ0๏ธโฃ Closures Preview
Closures are built on lexical scope.
Consider:
Output:
The returned function continues to access "count" even after "createCounter()" has finished executing.
๐ Double Tap โค๏ธ For More
โญ 1๏ธโฃ5๏ธโฃ What Is an Execution Context?
When JavaScript runs code, it creates an execution context.
An execution context is the environment in which JavaScript evaluates and executes code.
At a high level, there are different kinds of execution contexts.
The most important ones initially are:
โข Global Execution Context: Created when your JavaScript program begins executing.
โข Function Execution Context: Created whenever a function is called.
For example:
const name = "Rahul";
function greet() {
const message = "Hello";
console.log(message);
}
greet();
Conceptually:
Global Execution Context
โ
greet() called
โ
Function Execution Context
1๏ธโฃ6๏ธโฃ Creation Phase and Execution Phase
A simplified mental model is that JavaScript prepares an execution context before executing its statements.
During setup, JavaScript determines things such as:
โข Variable bindings
โข Function declarations
โข Lexical environments
Then JavaScript executes the code.
For example:
var age = 25;
function greet() {
console.log("Hello");
}
During the setup process, JavaScript prepares the relevant bindings.
Then execution proceeds through the statements.
This helps explain why function declarations and "var" behave differently from "let" and "const".
1๏ธโฃ7๏ธโฃ Execution Context Stack
JavaScript uses a call stack to keep track of active function execution.
Example:
function first() {
second();
}
function second() {
third();
}
function third() {
console.log("Hello");
}
first();The execution roughly looks like:
third()
โ
second()
โ
first()
โ
Global
When "third()" finishes:
third() removedThen:
second() finishesThen:
first() finishesEventually the stack becomes empty.
โญ 1๏ธโฃ8๏ธโฃ Call Stack
The call stack follows:
LIFO (Last In, First Out)
For:
function first() {
second();
}
function second() {
console.log("Hello");
}
first();The stack conceptually becomes:
1. Global
2. first()
3. second()
Then:
second() removedfirst() removedGlobal continues
Understanding the call stack becomes very important when we later study:
โข Callbacks
โข Asynchronous JavaScript
โข Promises
โข Event loop
โข Stack overflow
โญ 1๏ธโฃ9๏ธโฃ Scope vs Execution Context
These concepts are related but not identical.
โข Scope answers: "Where can this variable be accessed?"
โข Execution context answers more broadly: "What environment is JavaScript using while executing this code?"
For example:
const name = "Rahul";
function greet() {
const message = "Hello";
console.log(name);
console.log(message);
}
Scope determines which variables are accessible.
Execution context represents the environment created when "greet()" is actually executed.
โญ 2๏ธโฃ0๏ธโฃ Closures Preview
Closures are built on lexical scope.
Consider:
function createCounter() {
let count = 0;
return function () {
count++;
return count;
};
}
const counter = createCounter();
console.log(counter());
console.log(counter());
console.log(counter());Output:
1
2
3
The returned function continues to access "count" even after "createCounter()" has finished executing.
๐ Double Tap โค๏ธ For More
โค9
๐ง๐ข๐ฃ ๐๐ฅ๐๐ ๐๐ข๐จ๐ฅ๐ฆ๐๐ฆ ๐ง๐ข ๐๐ข๐ข๐ฆ๐ง ๐ฌ๐ข๐จ๐ฅ ๐ฆ๐๐๐๐๐ฆ ๐๐ก ๐ฎ๐ฌ๐ฎ๐ฒ!
Explore FREE online learning resources to develop in-demand skills and improve your career opportunities!
๐ Why Explore These Courses?
โ Learn valuable professional skills
โ Improve your resume
โ Build practical knowledge
โ Learn at your own pace
๐๐ ๐ฝ๐น๐ผ๐ฟ๐ฒ ๐๐ฅ๐๐ ๐๐ผ๐๐ฟ๐๐ฒ๐ ๐๐ฒ๐ฟ๐ฒ๐
https://pdlink.in/3VBdt6V
๐ก Learn New Skills โ Build Confidence โ Unlock Career Opportunities!
Explore FREE online learning resources to develop in-demand skills and improve your career opportunities!
๐ Why Explore These Courses?
โ Learn valuable professional skills
โ Improve your resume
โ Build practical knowledge
โ Learn at your own pace
๐๐ ๐ฝ๐น๐ผ๐ฟ๐ฒ ๐๐ฅ๐๐ ๐๐ผ๐๐ฟ๐๐ฒ๐ ๐๐ฒ๐ฟ๐ฒ๐
https://pdlink.in/3VBdt6V
๐ก Learn New Skills โ Build Confidence โ Unlock Career Opportunities!