Комментарии:
I didn’t understand one thing like while calling the z(); how 7 is printed can any one please explain it to me, n how z is called though it’s just a variable ?
Ответитьin the closures example how variable z becomes function in 11 line? can anyone explain please?
Ответитьbro just roasting all other language like they are nothing
Ответитьthanks sir ,I am falling with love in javascript
ОтветитьThank you for sharing
ОтветитьThank you so much bro!!! I've watching so many videos and reading articles and this is the one that sticks!! I can't believe it was just that simple!
Ответитьakahay saini is the king of javascript
ОтветитьForget Netflix. Binge-watching this masterpiece!
ОтветитьInterviewer: what is function?
me : Function is so beautiful so elegant just looking like WOW!!!
🎉
ОтветитьClosure is function bundled with lexical scope. Thank you saini sir
ОтветитьThis is due to shadowing...... x from 7 to 100
Ответитьvery informative
ОтветитьGreat work Akshay
Ответитьbro u nailed it
Ответитьtoday ending music was of ritviz
ОтветитьRevision Points :
1. A closure is a function that comes bundled with its surrounding variables (lexical scope).
2. Even when we return a function, it still remembers the environment it was created in, so it can access those variables.
3. If we write `return function x() { ... }`, we are returning the function itself, not its value. The function needs to be called to return a value.
4. The returned function is a reference, so any changes made to variables inside it will affect the original variables.
if anyone of the viewers is making note can you please share it with us !!!
ОтветитьWho drinks green tea ! Lol i laughed so hard at this. You make learning javascript so much fun akshay !
ОтветитьThanks
Ответитьclosure: Closure is a function that remembers and has access to the variables of it's outer scope even after outer function has finished executing.
for e.g -
function a(){
let c = 10;
function b(){
console.log(c);
}
return b;
}
let z = a();
z();
In above example the execution context of function "a" is long gone yet this function "b" remembers the values of variable c.
What extension you used in vs code
Ответитьgreat
ОтветитьOh my godd....I fell in love with his explanations of the closure concept. The way he explains the clouse concept was top notch😍
Ответитьplot twist: tomorrow you have js interview
ОтветитьNot clear explanation
Ответитьvideo is useful
Ответитьhindi mein samjhao sir
Ответитьwtf is going on...hahaha
ОтветитьCan you explain y im getting 3 and undefined at output for this code function x(){
var a=3;
function y(){
console.log(a);
}
y();
}
let z=x();
console.log(z);
my doubt is i wrote y() in x() function so when i access x() through let Z why its showing undefined ? it return 3 for the first time why undefined for 2nd time for not mentioning return statement.
I want to say we love you man! Thank you for all the efforts and time you devote to making awesome videos like this.
ОтветитьBhaiya thala for reason😝
Ответить🙃🙃🙃🙃
Ответитьclosure and execution context are different or same
ОтветитьGood Afternonn...Your teaching process...Nice understanding process of closures.
Ответитьplease please cover more topics in js , like projects n all please akshay.
Ответитьenjoying a lotttt thnkxxxx.
Ответитьhow can i setup my browser to check this scope and watch window, I know there are their but its not showing like this . Could you please help
ОтветитьYour explanation is really amazing. Thank you so much sir 🙏🙏🙏
Ответитьbkc sexyyyy
Ответитьsir one word you are just amazing.
Ответитьdrink black tea
ОтветитьLove the way you explained
& about green tea also
😄
I am so excited!!!!!!!!!!!!!!!!! lets goooooo
ОтветитьFantastic video found on closure,which cleared all my doubts....thanks for all your efforts that you put in.
Ответитьgreat teacher
Ответить