Closure :Function bundled with its lexical environment is known as a closure. Whenever function is returned, even if its vanished in execution context but still it remembers the reference it was pointing to. Its not just that function alone it returns but the entire closure and that's where it becomes interesting !! Thank you so much, Akshay for this :) :)
I've completed my master's in mechanical enginnering, and after that, I planned to switch my career in the IT industry. Yesterday, I cracked the first round of interviews for the position of front-end developer. All the questions on JS were from your videos, and I can bet that the interviewer has also watched your Namaste Javascript series.
Four things I like about Akshay. 1) Doesn't try and speak in an American accent, like most Indian UA-cam programmers. 2) Passionate 3) Someone with real knowledge. 4) A talented teacher.
A closure gives access to all the variables of it's parent function even after the that parent function has returned or executed. The function keeps a refernce to it's outer scope which preserves the scope chain throughout the time
Things learned: 1. Function bundled with lexical scope is called closure. 2. Even if we return the function, it still remembers its original lexical environment and local storage so it can access values. 3. If we write return function x(){.....} --- this automatically returns the value. 4. The function that is returned is reference so any change in value of that variable inside function will be reflected as such.
I regularly take interviews, give interviews, I have event watched the entire Namaste JS series multiple times. Still came to this video like 10th may be 12th time to revise closures. This is highly satisfying knowledge. Thanks a lot @Akshay. More power to you :)
i am backend developer and just started to explore frontend tools. No one can explain javascript better then you Sir. all the best, stay healthy and help us all junior developers to learn complicated things. Thanks .
Bro!! two days back JS is a horror movie for me, now I started liking JS more, lexical scope video is awesome...thanks for your efforts, I like the way how you explain. Credit goes to you.
One of the finest JavaScript tutorials available, it showcases the art of a talented teacher who effortlessly breaks down complex concepts into easily understandable content.
Mainly closures & this keyword helped me land a great new job. Thanks Akshay for creating such a great course (Namaste JS Season 1 & 2). I recommend this series to everyone as a prerequisite towards their frontend job search.
11:25 I am watching js video along with some cool drama show 🤣🤣. I was watching your video because of js and my sister in class 10 was watching you because of your funny expression.
i feel like that the creation phase/execution conext is like one of the most crucial concept in js... nearly everything is explainable by creationphase/hoisting and the scopes
Never read or tried to learn JavaScript... But, Started directly to work on it and it's been almost 8 years.. Now these videos are making me realize , why I struggled with those setTimeout n all ..
I have been watching his videos in incognito (just the way I am), and didn't even think of liking videos and stuff. but the moment of GREEN TEA. Man, that literally made me open the video in main window, just to comment this. Akshay, you never fail to make videos interesting, be with the kind of energy you put into and the way of explaining things. Nice work. Green Tea man. LOL.
Hi akshay, after complete the Namaste js playlist, please make a playlist for Namaste react. Tons of video out there for react, but your teaching will be easy to grab the core concepts. It's our kind request 🙏...
Voting for React and also for Node.JS and other backend technologies since this man is the only instructor that I have found who cares enough to go in depth and also show behind the scenes kind of stuffs.
Today i have seen this chapter and attended an interview. I had a question about closure and i was so excited to answer it, done it successfully but the 2nd question in closure was let scope function a (){
function b{ let x = 3; } function c{ let y = 4; } function d{ console.log(x,y) } } now how to change this code to access the x and y variables inside d(), I simply told change let to var, but the suggested answer was we can write like below function a (){ function b{ let x = 3; function c{ let y = 4; function d{ console.log(x,y) } } } } However, this helps me lot. :)
Watching it for second time , with same amount of satisfraction , Your teaching way if so unique that , Your definations just hit the mid point of the brain which saves the content automatically !
I was trying to get this concept since morning by roaming here and there, saw many videos even in hindi which is our mother language and came across your video, and trust me i got it at once😍😍, I didn't had to play your video again and again, it's just your way of teaching is literally awesome and now I got a mentor... Thank you so much man,🥰 All i can feel is if a person could understand english language and still doesn't get what javascript really is by your videos, he/she is not meant for coding.
Woah... I have watched numerous videos on closure. Looking at the 20+ mins duration made me reluctant at first. Halfway through the video and looks like I'm finally able to understand this topic. THANK YOU BROTHER ♥
Really explained well. I love the enthusiasm of your explanation and your expressions. Really excited for next video. Requesting to cover the topics of generators, iterators.
Bahut jgh pdha..mdn v dekha tha utne acche se ni smjh aaya but yha full clear hua bhut acche se . Ab refrence aapka v lunga js related.dhywaad aur bhgwaan aapko aise hi aage badhate aur khus rakhe ❤️
You are an outstanding Guru !!! Before watching this video, I had watched 5,6 videos but could not understand anything, but you made me know this within minutes! You are a genius!!
How tough the subject is. Its not a matter. If we find a good master. We can make it! Akshay a legend! My master u r! I m learning js. One day definitely will get a job.i will put in this comment box.credits to u master!
The most amazing thing in Sir Akshay is he explain the exact meaning of each term and usage in coding ,that most developer dont even noticed these things they Just clear how they work but dont know the exact background of each term,And here Sir explain both So Bundle of thanks Sir je
Thank-you Akshay. I love watching your videos. You are first and last my favourite instructor of js. Please keep making videos on js advance. I was watching my instructor video around 3 hours but didn't understand not even a single line but when I learnt from you. I understood easily. Kindly cover oops LLD Promise Fetch api these kind of topics too. So that we all be good at programing like you.🙏🙏🙏🙏🙌🙌🙌🙌🙌❤️❤️❤️🎉
i am learning js from last 1 year but never understand js in so much depth. Now i can say that i am good in js and have depth knowledge of it. All thanks to you 🥰
Topics should be covered. It can help the whole javascript community and me ofcourse. 1. Promises 2. async/await 3. callbacks 4. Polymorphism and inheritance in javascript 5. Memoization 6. Prototype
Loved the video! Closure definition: a function bound together with its lexical environment. This means an inner nested function has access to its parents' lexical scope, and is able to remember variables the were declared in that environment, even after that functions has been removed from the call stack. You did a very good job of explaining this. I think I've got a ways to go before I totally understand all this stuff though :P
Yes I will able to give answer in my interview now ... when we have returned function it not just the function code return but a closure enclosed alongwith lecxical scope will returned. Closure: Function alongwith it's lexical scope forms a closure i.e., known as Closure ❤
Next Video: setTimeout + Closures Interview Question 🔥 - ua-cam.com/video/eBTBG4nda2A/v-deo.html Kaisa laga video? Are you feeling excited? Let me know in the comments below. ❤️
Thank you, it is a great help, I am preparing for the interview for the role of a frontend developer. I was waiting for this topic for so long since you have covered it is a great help.
this is more worth than any tutorials i am sure i got placement for a angular developer in a company they also asked me javascript questions i am sure everyone who is learning this course it's worth always remember react or angular it's just a library of javascript javascript is the main thing learn that deeply like akshay saini tell you all the best thank you akshay love you i am 19 years old now
First time landed to your channel in my journey of two years learning and development and I really appreciate the way you explain I was searching for closure and have read blogs watched videos things was clear to me but I was seeking a good definition and you provided it. then explained it very well through the example. Keep it up. Wish you great luck for your future,
Kudos for explaining this important concept. But mentioning things like y remembers the reference of a is vague, better will be to mention how a is stored in memory and how y is able to acess that reference outside x.
"Microservices architechture", I think you should cover this, reason being most of us are very confused about what it actually is, how to use it and where??
For revision : Q)What is closure? A)The function bundled with its lexical environment closed to that function simply function + Lexical environment and closures have very special place in runtime environment The fun in JavaScript is you can assign a variable for a function and also you can pass function as a parameter even you can return the function in JavaScript!! Myself : ua-cam.com/video/74hA6Q7vPI4/v-deo.html Q)What does the closure do in my JavaScript programs? A) Whenever I call a function in JavaScript the closure maintains its values(lexical env.) and function in its own runtime and when that specific function executed, it returns with own environment even the variable vanished after its execution 11:36 : Simaran! because is on Diet 13:54 : as variable value is changed before executing the return (the function) Value will be 100 In closures, values in variable are 'pass by reference' hence there values can be changed, and whenever comes the closure inside closure(multilevel one) we can see the function refers the 'parent' variable My Response 21:38
@@pekalarajesh6147 Since the assignment of the value '100' was after the declaration of the function 'y', but was before the actual function call. When the function 'x' was executed, the assignment 'a = 100' was processed, and the reference to 'a' is what persists, not the actual value at 'a'.
UPDATE : SERIOUSLY GOT A JOB BECAUSE OF THIS ! NOT KIDDING THIS TIME ! Went to an interview. Interviewer: Write an example of closure. Me: Wrote down this example Interviewer: Namaste Javascript ? 🤨 Me: 😐 Interviewer: Even I have the same example in mind. High five'd each other. Happily working ever after 🥳🥳🥳
Things Learned: 1. Function bundled with its lexical environment is known as a closure. 2. Whenever function is returned, even if its vanished in execution context but still it remembers the reference it was pointing to. Its not just that function alone it returns but the entire closure and that's where it becomes interesting.
I used to be this mush excited about javascript, but now i am kinda stuck with .net core for a while. But i absolutely love javascript and closures. watched this videos because of the good old memories. Nostalgic!! Still remember the way i explained it to my juniors
I watched 3 videos to understand closures and I was lost, but finally understood here, the way you covered every single thing... It is really very helpful. Thank you!
First of all namaste for namaste JavaScript sir you cleared JS concept like when we doing simply to Namaste anyone.. Thanks for Namaste JS.. Please make more....... I am waiting⏳⏳⏳...
Hello, thank you for this mind blowing series! I've a doubt regarding closures. Here's my very brief explanation of closures. - A Closure "space" is created, apart from the Execution Context, whenever a reference to any variable or function is made from an inner function, so that even the EC of outer function goes out of scope, we've access to the required variables. So It contains the function bundled with the lexical env. My doubt is regarding the "space", I don't exactly understand what a closure is physically in memory. Is like an execution context or just a separate space or something else. Once again thanks a lot for this amazing content.
We can assume it to be a separate space in the memory, because we know that variables are stored in memory spaces. And, for sure it is not an execution context. Just like in the memory space we have different sections like - global, local (you must have observed this when a functional execution context is created), script (for hoisting let and const declarations), in the same way closure is also a separate memory space.
yesterday i had interview and he ask me closure i was not able to answer him, now i can explain anyone thanks akshay..............kash ye video pehle dekh liya hota
Closure :Function bundled with its lexical environment is known as a closure. Whenever function is returned, even if its vanished in execution context but still it remembers the reference it was pointing to. Its not just that function alone it returns but the entire closure and that's where it becomes interesting !! Thank you so much, Akshay for this :) :)
Thanks
Buddy, was it necessary to be rude?
You put it in beautiful words
@@pranjalrathod2158 rude? Who?
@@sss-kd9md that guy deleted the comment now. Let's ignore
My interviewer got impressed when I explained the way you explained. Dude you are a 💎.
Wohooo! ✌️😎
For which role you applied?
Rest of the world : JS is hard and crazy
Akshay : hold my green tea.
Hitesh: Hold my ice tea.
@@AmrithMS travery media....are u challenging me?
@@Oldstoryhouse the new Boston..... focking noobs
javascript is the most beautiful language and typescript is legendary with those types
@@Oldstoryhousep
I've completed my master's in mechanical enginnering, and after that, I planned to switch my career in the IT industry.
Yesterday, I cracked the first round of interviews for the position of front-end developer.
All the questions on JS were from your videos, and I can bet that the interviewer has also watched your Namaste Javascript series.
Wow😂 bro..
Congratulations, Faraz. You’re inspiration to many! ♥️
@@akshaymarch7 Thanks bro. I've joined that company on 6th September. Apart from that, I got one more offer as front-end developer.
@@farazhusain925 i m looking for job as front end developer can you help me how to find it
@@farazhusain925 I am also looking for job as front end developer recently I have completed HTML CSS and JavaScript presently i am learning reactjs
Four things I like about Akshay.
1) Doesn't try and speak in an American accent, like most Indian UA-cam programmers.
2) Passionate
3) Someone with real knowledge.
4) A talented teacher.
Love you! ♥️
hes very authentic,first time i thought he was quite weird owing to the fact that im not indian but now i cant get enough of his content
That's what make him unique!
you mean Hitesh choudhary ?
@@us-xf3kk 🤣
A closure gives access to all the variables of it's parent function even after the that parent function has returned or executed. The function keeps a refernce to it's outer scope which preserves the scope chain throughout the time
One step closer to Closure.
Thank you Akshay, I cleared my JS interview because of your videos only.
Congratulations, brother! ❤️
I am beginner please give some tips
@@akshaymarch7 comment testing
As a Mechanical Engineer, I'm really enjoying this course. The way you are explaining is simply superb.
Bhaiya is high on JS 😂. More power to you.
Haha !! So much passion for Javascript . Great !
Indeed! :D
Closures is another level
High on Javascript and green tea....Snoop Dogg no match xD
Exactly..
Things learned:
1. Function bundled with lexical scope is called closure.
2. Even if we return the function, it still remembers its original lexical environment and local storage so it can access values.
3. If we write return function x(){.....} --- this automatically returns the value.
4. The function that is returned is reference so any change in value of that variable inside function will be reflected as such.
bro is everywhere Thank you for this notes.
this dude makes me fall in love with JS. And, yes. i'll never have to find another video on closures. thanks a million!
I regularly take interviews, give interviews, I have event watched the entire Namaste JS series multiple times. Still came to this video like 10th may be 12th time to revise closures. This is highly satisfying knowledge. Thanks a lot @Akshay. More power to you :)
🚀🚀🚀
@@akshaymarch7 Checking nested comments on youtube
i am backend developer and just started to explore frontend tools. No one can explain javascript better then you Sir. all the best, stay healthy and help us all junior developers to learn complicated things. Thanks .
Bro!! two days back JS is a horror movie for me, now I started liking JS more, lexical scope video is awesome...thanks for your efforts, I like the way how you explain. Credit goes to you.
One of the finest JavaScript tutorials available, it showcases the art of a talented teacher who effortlessly breaks down complex concepts into easily understandable content.
Brooo never seen anyone teaching online with that excitement!!! This is soo good! the content and the learning :))
Mainly closures & this keyword helped me land a great new job. Thanks Akshay for creating such a great course (Namaste JS Season 1 & 2). I recommend this series to everyone as a prerequisite towards their frontend job search.
Wish you the best, keep rising! 🚀
These videos are amazing. Its the depth, the enthusiasm, the great explainations etc….
11:25 I am watching js video along with some cool drama show 🤣🤣. I was watching your video because of js and my sister in class 10 was watching you because of your funny expression.
Hahaha 😂
Ask her to subscribe for more drama. 😂
Another seriously underrated JS channel. Clear and simple explanation. Thank you Namaste :)
can u tell us more underrated JS channels.
i feel like that the creation phase/execution conext is like one of the most crucial concept in js... nearly everything is explainable by creationphase/hoisting and the scopes
Never read or tried to learn JavaScript...
But, Started directly to work on it and it's been almost 8 years..
Now these videos are making me realize , why I struggled with those setTimeout n all ..
Best video on CLOSURE...the energy level and the content🔥🔥🔥...thanks a lot..😎😎
I have been watching his videos in incognito (just the way I am), and didn't even think of liking videos and stuff. but the moment of GREEN TEA. Man, that literally made me open the video in main window, just to comment this. Akshay, you never fail to make videos interesting, be with the kind of energy you put into and the way of explaining things. Nice work. Green Tea man. LOL.
Damn bruh! It got aggressive real quick!!!
Reminds me of that Maths teacher yelling at the screen 😂
Haha, that math teacher was my favorite. 😂
haha! bhut sahi
FUNCTIONS=MISS UNIVERSE!!
BTW LOVELY EXPLANATION
Bhaiya, Please don't ever delete this playlist!!!..This is super helpful and helps me revise it before the interview!!!!
Mujhe Closure kisi aise hi passionate instructor se samjh aa sakta tha.....Thanks man
If the video would have been 3 hours long I would have seen it with full enthusiasm.
Thanks Akshay sir.
Keep posting.
❤️
Studied JS from alot of resources but this man made me fall in love with it , a true guru 🙏🏻, just remarkable
Hi akshay, after complete the Namaste js playlist, please make a playlist for Namaste react. Tons of video out there for react, but your teaching will be easy to grab the core concepts. It's our kind request 🙏...
JavaScript itself is vast, but yeah once he completes that...may be he can put a udemy course for React.
😀
That would be awesome!
Vote for reactjs :D
Voting for React and also for Node.JS and other backend technologies since this man is the only instructor that I have found who cares enough to go in depth and also show behind the scenes kind of stuffs.
Yes pleaseeee
your energy while teaching is next level........
Only Legends would Binge watch This series😎 #JS😘😀😁
Today i have seen this chapter and attended an interview. I had a question about closure and i was so excited to answer it, done it successfully but the 2nd question in closure was let scope
function a (){
function b{
let x = 3;
}
function c{
let y = 4;
}
function d{
console.log(x,y)
}
}
now how to change this code to access the x and y variables inside d(), I simply told change let to var, but the suggested answer was we can write like below
function a (){
function b{
let x = 3;
function c{
let y = 4;
function d{
console.log(x,y)
}
}
}
}
However, this helps me lot. :)
Changing let to var will not work as var is 'function scoped' so we cannot access it outside the function.
Really love your energy! Your content is really helping with my interviews!!
Watching it for second time , with same amount of satisfraction , Your teaching way if so unique that , Your definations just hit the mid point of the brain which saves the content automatically !
Man how can a student not be excited if the teacher himself is so so much excited. Great video bro
❤Function are so beautiful ❤
So elegant 🎉
Just looking like a wow 😂😅😊
Finally, today I can sleep peacefully. We won over closure after watching this video. 😅
I was trying to get this concept since morning by roaming here and there, saw many videos even in hindi which is our mother language and came across your video, and trust me i got it at once😍😍, I didn't had to play your video again and again, it's just your way of teaching is literally awesome and now I got a mentor... Thank you so much man,🥰 All i can feel is if a person could understand english language and still doesn't get what javascript really is by your videos, he/she is not meant for coding.
You make complex topics feel like a "Hello World" program 🙏. You truly have a knack for teaching.
Probably the most concise explanation of closures. Awesome teaching!
I was waiting for this since long 😃 Today I will sleep well ✨
True.
Me2😀
Wow amazing bro....
Same here...!! Excited..!!!
Woah... I have watched numerous videos on closure. Looking at the 20+ mins duration made me reluctant at first. Halfway through the video and looks like I'm finally able to understand this topic.
THANK YOU BROTHER ♥
Really explained well. I love the enthusiasm of your explanation and your expressions. Really excited for next video. Requesting to cover the topics of generators, iterators.
Bahut jgh pdha..mdn v dekha tha utne acche se ni smjh aaya but yha full clear hua bhut acche se . Ab refrence aapka v lunga js related.dhywaad aur bhgwaan aapko aise hi aage badhate aur khus rakhe ❤️
Vinoth love❤️ >> Akshay:
One thing i forgot to inform bro dress code And hairstyle is awesome
And finally End music is Vera level :)
Coding from last 11 years and never seen this beauty of JS. Thank you so so much 💖
I have nothing to do with JS, and yet I am watching this as if my life thrives upon it.
Going great like always! 🤗🤗
Thank you so much, Simran 🤗
You are an outstanding Guru !!! Before watching this video, I had watched 5,6 videos but could not understand anything, but you made me know this within minutes! You are a genius!!
How tough the subject is. Its not a matter. If we find a good master. We can make it! Akshay a legend! My master u r! I m learning js. One day definitely will get a job.i will put in this comment box.credits to u master!
the moment you said "you will love this" at 3:45s and the expression you gave, that felt like i am really gonna love this :p
The excitement level is the dam high
I was looking for this comment, checking whether it mee or someone else also thinking the same 😂♥️
@@mohit96nain yo bro 🤣
@@mohit96nain mee too, thinking of it same 😅
Oh my godd....I fell in love with his explanations of the closure concept. The way he explains the clouse concept was top notch😍
Akshay Saini is on a mission to make all of us great at JS. Thank you so much man
The most amazing thing in Sir Akshay is he explain the exact meaning of each term and usage in coding ,that most developer dont even noticed these things they Just clear how they work but dont know the exact background of each term,And here Sir explain both
So Bundle of thanks Sir je
Namasty Bro. I think you're impacting more knowledge than most schools🙏🙏🙏
I'm so excited!!!
Thank-you Akshay. I love watching your videos. You are first and last my favourite instructor of js. Please keep making videos on js advance. I was watching my instructor video around 3 hours but didn't understand not even a single line but when I learnt from you. I understood easily.
Kindly cover
oops
LLD
Promise
Fetch api these kind of topics too. So that we all be good at programing like you.🙏🙏🙏🙏🙌🙌🙌🙌🙌❤️❤️❤️🎉
i am learning js from last 1 year but never understand js in so much depth. Now i can say that i am good in js and have depth knowledge of it. All thanks to you 🥰
Topics should be covered. It can help the whole javascript community and me ofcourse.
1. Promises
2. async/await
3. callbacks
4. Polymorphism and inheritance in javascript
5. Memoization
6. Prototype
All of these are coming!! 💥
@@akshaymarch7 we are waiting for these topics
@@akshaymarch7 i am also eagerly waiting for those topics
@@akshaymarch7 waiting please upload the videos as soon as possible plz bro
@Akshay Sani . Waiting for these too :)
Loved the video! Closure definition: a function bound together with its lexical environment. This means an inner nested function has access to its parents' lexical scope, and is able to remember variables the were declared in that environment, even after that functions has been removed from the call stack.
You did a very good job of explaining this. I think I've got a ways to go before I totally understand all this stuff though :P
Chitvan(Hope you know the legend): Baba, you are beautiful
Akshay: JavaScript, you are beautiful 😃
Yes I will able to give answer in my interview now ... when we have returned function it not just the function code return but a closure enclosed alongwith lecxical scope will returned.
Closure: Function alongwith it's lexical scope forms a closure i.e., known as Closure ❤
Getting to learn a lot. Thank you so much for sharing your knowledge . This course is helping me a lot.
i literally laughed on the statement and the expressions , "This is what closuer is" :D, Great way of explaining.
Next Video: setTimeout + Closures Interview Question 🔥 - ua-cam.com/video/eBTBG4nda2A/v-deo.html
Kaisa laga video? Are you feeling excited? Let me know in the comments below. ❤️
awesome video, earlier for long i am running from JS but now truly i am enjoying learning JS and exploring more, tons of thanks to you...
Thank you, it is a great help, I am preparing for the interview for the role of a frontend developer.
I was waiting for this topic for so long since you have covered it is a great help.
Jhakaas jhakaas jhakaas
Great. The way you teaching is Great.
Amazing and very detailed as always..😊😊
This is genuinely the best video I have ever seen
I have watched 1000 videos before this and i can guarantee you i will not watch again any video of closure again . Thanks Akshay
this is more worth than any tutorials i am sure i got placement for a angular developer in a company they also asked me javascript questions i am sure everyone who is learning this course it's worth always remember react or angular it's just a library of javascript javascript is the main thing learn that deeply like akshay saini tell you all the best thank you akshay love you i am 19 years old now
He literally treats people who learn other languages as aliens! :D Indeed JS is beautiful.
I love Aliens. ❤️
@@akshaymarch7 i love AYushi
@@currentadda7884 bhai chill lol
First time landed to your channel in my journey of two years learning and development and I really appreciate the way you explain I was searching for closure and have read blogs watched videos things was clear to me but I was seeking a good definition and you provided it. then explained it very well through the example. Keep it up. Wish you great luck for your future,
Kudos for explaining this important concept.
But mentioning things like y remembers the reference of a is vague, better will be to mention how a is stored in memory and how y is able to acess that reference outside x.
Nice point
The best JS video.....I have ever watched....Engaging, fun, and very well explained. Many thanks!
"Microservices architechture", I think you should cover this, reason being most of us are very confused about what it actually is, how to use it and where??
functions are
so beautiful
so elegant
just work like a wow.... 😍🤩
Me (30 mins before interview) - Note that, note that!!!
best video series I have ever seen about javascript and it's peculiarities. thank you Akshay Saini!
For revision :
Q)What is closure?
A)The function bundled with its lexical environment closed to that function
simply function + Lexical environment
and closures have very special place in runtime environment
The fun in JavaScript is you can assign a variable for a function and also you can pass function as a parameter even you can return the function in JavaScript!!
Myself : ua-cam.com/video/74hA6Q7vPI4/v-deo.html
Q)What does the closure do in my JavaScript programs?
A) Whenever I call a function in JavaScript the closure maintains its values(lexical env.) and function in its own runtime and when that specific function executed, it returns with own environment even the variable vanished after its execution
11:36 : Simaran! because is on Diet
13:54 : as variable value is changed before executing the return (the function) Value will be 100
In closures, values in variable are 'pass by reference' hence there values can be changed, and whenever comes the closure inside closure(multilevel one) we can see the function refers the 'parent' variable
My Response 21:38
@0xFOXHOUND
hello bro can u please explain me why we got the value as 100...not 7
at 13:30
@@pekalarajesh6147 Since the assignment of the value '100' was after the declaration of the function 'y', but was before the actual function call. When the function 'x' was executed, the assignment 'a = 100' was processed, and the reference to 'a' is what persists, not the actual value at 'a'.
You are diamond 💎 sir with no doubt .continue this way teaching .I never boarded with your series
UPDATE : SERIOUSLY GOT A JOB BECAUSE OF THIS ! NOT KIDDING THIS TIME !
Went to an interview.
Interviewer: Write an example of closure.
Me: Wrote down this example
Interviewer: Namaste Javascript ? 🤨
Me: 😐
Interviewer: Even I have the same example in mind.
High five'd each other. Happily working ever after 🥳🥳🥳
hahha
Hahaha😂😂
People say communication is the key trait of growth and everything and I could see it today in this session! need to work on it bruh!
Things Learned:
1. Function bundled with its lexical environment is known as a closure.
2. Whenever function is returned, even if its vanished in execution context but still it remembers the reference it was pointing to. Its not just that function alone it returns but the entire closure and that's where it becomes interesting.
지렸습니다 진짜 이정도로 깨우쳤다는 느낌을 받은 것은 처음입니다 속이 시원하네요 감사합니다
Dude, nice hairstyle and video.
I used to be this mush excited about javascript, but now i am kinda stuck with .net core for a while. But i absolutely love javascript and closures. watched this videos because of the good old memories. Nostalgic!! Still remember the way i explained it to my juniors
It wasn't a green tea, it was a cocktail of JS pills, cocaine, and steroids. The man is on a killing spree in this video. Great fuckin' work!
I watched 3 videos to understand closures and I was lost, but finally understood here, the way you covered every single thing... It is really very helpful. Thank you!
Senior and cool developers disliked the video because they still didnt get it !
😅
First of all namaste for namaste JavaScript sir you cleared JS concept like when we doing simply to Namaste anyone.. Thanks for Namaste JS.. Please make more....... I am waiting⏳⏳⏳...
1:30 you sounded like Arnab Goswamy
Hahaha 😂 😂
Hello, thank you for this mind blowing series!
I've a doubt regarding closures. Here's my very brief explanation of closures.
- A Closure "space" is created, apart from the Execution Context, whenever a reference to any variable or function is made from an inner function, so that even the EC of outer function goes out of scope, we've access to the required variables. So It contains the function bundled with the lexical env.
My doubt is regarding the "space", I don't exactly understand what a closure is physically in memory. Is like an execution context or just a separate space or something else.
Once again thanks a lot for this amazing content.
We can assume it to be a separate space in the memory, because we know that variables are stored in memory spaces. And, for sure it is not an execution context. Just like in the memory space we have different sections like - global, local (you must have observed this when a functional execution context is created), script (for hoisting let and const declarations), in the same way closure is also a separate memory space.
10:45 😂😂😂😂😂
Hahaha 😂
yesterday i had interview and he ask me closure i was not able to answer him, now i can explain anyone thanks akshay..............kash ye video pehle dekh liya hota
17:05 : "If I call my x"
Bruh been calling her ,she doesn't pick up, what to do😭😭
hahahha
Ye baap level explanation hai
Whenever I want to revise JS concepts, I visit your channel
I want to say we love you man! Thank you for all the efforts and time you devote to making awesome videos like this.
Man!!! I like how you are passionate about closure, I wasn't planning to watch the next video, but I will now
Broo with this excitement i havent seen anyone teaching like this ... its just flawless and easy to grab everything 😍..thank you!
And here comes the closer of all doubts for me about "Closer". Thanks Again