57. What is Execution Context, Calling Stack, Lexical Environment, Environment Record in JavaScript?

Поділитися
Вставка
  • Опубліковано 14 лис 2024

КОМЕНТАРІ • 15

  • @eashan2405
    @eashan2405 Рік тому +1

    The best explanation I ever found on this topic..!! thank you so much Miss Xing.

  • @macciocapatonda666
    @macciocapatonda666 2 роки тому

    You are a fantastic programmer and a great teacher. Thanks to you I finally understood how the execution context works.

  • @a_basic_sheep_1993
    @a_basic_sheep_1993 2 роки тому +1

    great job

  • @gt-uj6fz
    @gt-uj6fz 2 роки тому

    hello, do you video about security in spring boot?

  • @tenzl
    @tenzl Рік тому

    Hi, thank you very much for the video. I have a question though,
    I've always read that there is only a global execution context and a function execution context, but if I understand correctly from your videos, an execution context is created when there is a block of code that contains a let or a const? so the structure of that lexical environment for such a code block would not contain an arguments object, it only contains a reference to the parent lexical environment (called outer) and any let/consts that are defined within it? are function declarations inside such a block also only available in the if block's execution context or does the parent have access to the if block's function declaration?

    • @yourfavorite4165
      @yourfavorite4165 Рік тому

      Did you find the answer to this question?

    • @eashan2405
      @eashan2405 Рік тому

      No. For block scope containing let/const, a new Lexical environment is created, not an Execution context. However, the Lexical Environment functions similar to the Execution context.

  • @and.v761
    @and.v761 Рік тому

    what will happen with `a`, `b` and arguments obj if I assign a detail value to parameter on function declaration?
    example:
    function sum (a = 6, b =5) {
    console.log(a+b);
    };
    sum();

    • @mitesh5189
      @mitesh5189 Рік тому +2

      Then a ans b will be stored in local memory scope because you are assigning that values

    • @mitesh5189
      @mitesh5189 Рік тому +2

      And if incase of a and b assigned to sum parents then also a and b will be considered as local memory (6,5) which ever first comes in chain will be considered

    • @and.v761
      @and.v761 Рік тому

      ​@@mitesh5189 so, what are differences between arg variable and argument object. whose value with be used firstly by function?

    • @mitesh5189
      @mitesh5189 Рік тому

      @@and.v761 detail value to parameter is like default parameter so it will apply if you don`t pass any parameter time of function call (suppose you assign value of a and b before this function it won`t effect) but in case of if you pass different value in parameter it will use that value
      var a = 5; // this value won`t be consider by fun
      function myFunction(a=10, b=a) { // this value will be consider reason it`s in local scope
      console.log('a = ' + a + '; b = ' + b);
      }
      myFunction(); // a=10; b=10
      myFunction(22); // a=22; b=22
      myFunction(2, 4); // a = 2 b = 4

    • @and.v761
      @and.v761 Рік тому +2

      @@mitesh5189 ok...There are a few things that are not clear.
      the argument object will record any real values that we pass into funciton. So, why we need declare the 'arg' variable as the video on creation phase?? I things argument object is enough. Get back my example
      function sum(a, b) {
      return a+b
      }
      sum(2,4) // creation phase: a=2, b=4, argument obj [0: 2, 1: 4] ????

  • @wightknight7056
    @wightknight7056 2 роки тому

    You need time codes

  • @dumchik7290
    @dumchik7290 Рік тому

    This video is very knowledgeful but your voice is not clear. It seems like u are chewing something, drinking your saliva and tries to explain us.