Understanding Execution Context in Javascript


Each part of your JavaScript code is executed in an “execution context,” which dictates what variables are available.

Source Code

function outer() {
  let a = 1;
  function inner() {
    let b = 2;
    console.log(a + b); // 3
  }
  inner();
}
outer();
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments