Javascript Tutorial | Scope & Closures | Ep20

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

КОМЕНТАРІ • 19

  • @NguedjoSan
    @NguedjoSan 6 років тому +19

    error @3:34....runExpression() is not returning add() but the value 100

  • @pledgeshield
    @pledgeshield 7 років тому +5

    Best explanation of JS closures and I have watched dozens of videos and I have red dozens of articles about this topic! Keep up the good work!

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

    WOW! QUITE IMPRESSIVE AN EXPLANATION OF SCOPE AND CLOSURE! I THINK, THAT I DO UNDERSTAND WHAT YOU MEAN, BUT IT IS REALLY DIFFICULT TO FIGURE OUT. THANKS A LOT FOR YOUR GREAT WORK!

  • @DuckTapeDemon1
    @DuckTapeDemon1 3 роки тому

    Thank you for explaining closures so well !!!!!

  • @blob1190
    @blob1190 4 роки тому

    Briilliantly explained. This concept was literally giving me a headache until I found your video, and I get it now. Thank you so much.

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

    very good explanation, thank you very much.

  • @HuaJarry
    @HuaJarry 6 років тому +1

    It's a little bit of different from the traditioinal stack execution model, isn't it? traditional execution stack model like a pyramid, the new coming callabl object is stack on the last callable object, so the top one can access almost the stacked symbol. but in your animation, runexpression callable object is get ridded after it executed. while it's not.

  • @user-vh3lm3qo4t
    @user-vh3lm3qo4t 2 роки тому

    Fantastic video! Far to many explanations of these concepts abstract away from the underlying mechanics. As a result a lot of value is lost for an individual seeking to understand the concept. Thank you.

  • @kamichikora6035
    @kamichikora6035 4 роки тому

    Great great content!!!
    I'm a new fan

  • @nayemislam2029
    @nayemislam2029 3 роки тому +1

    Ssys stack..but shows queue

  • @HuaJarry
    @HuaJarry 6 років тому +2

    add console.log("check") after add(); AND add a console.log in the add method. so it will prove that add method has been executed but the b is wipe out stack, so my added statement will execute and log out a word,
    so the b below is totally new one, it is none of the b in add method business. this b is just not defined, cause its hoisting only hoist the defined symbols, like var ***, const ***, and the first citizen symbol.
    anyway, thanks a lot.. thanks your great work.

    • @codewithnd5761
      @codewithnd5761 3 роки тому

      You're very correct. The call to Add() is actually executed but the variable 'b' is out of scope. So it can not be accessed from the outside.

  • @SuperSamsosa
    @SuperSamsosa 4 роки тому

    doesnt the stackdirection go from bottom to top , unlike your explanation ?

  • @Programming-Fun-With-Hima
    @Programming-Fun-With-Hima 4 роки тому

    What a lovely accent..

  • @JeffRAX
    @JeffRAX 5 років тому

    pots or parts lol?

  • @paxle
    @paxle 3 роки тому

    Function runExpression always return 100 and it's not result of function add(). Wrong example !!!