Javascript Tutorial | Scope & Closures | Ep20

preview_player
Показать описание
This Javascript tutorial covers the idea behind scope as a way of accessing symbols storing values in memory. Also closures are a language feature for keeping symbols (var, let, cons) for a temporary amount of time until they are deleted out of memory by GC or garbage collection.

Рекомендации по теме
Комментарии
Автор

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!

pledgeshield
Автор

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

NguedjoSan
Автор

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!

hannabouttros
Автор

Thank you for explaining closures so well

DuckTapeDemon
Автор

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

blob
Автор

very good explanation, thank you very much.

amirhosseinghasemi
Автор

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.

vhlmqot
Автор

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.

HuaJarry
Автор

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

kamichikora
Автор

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.

HuaJarry
Автор

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

SuperSamsosa
Автор

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

paxle