Closures in JS 🔥 | Namaste JavaScript Episode 10

  Рет қаралды 886,404

Akshay Saini

Akshay Saini

Күн бұрын

Пікірлер: 1 600
@sougandikal6022
@sougandikal6022 3 жыл бұрын
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 :) :)
@Sksahu_123
@Sksahu_123 3 жыл бұрын
Thanks
@pranjalrathod2158
@pranjalrathod2158 3 жыл бұрын
Buddy, was it necessary to be rude?
@dandalasuman
@dandalasuman 3 жыл бұрын
You put it in beautiful words
@sss-kd9md
@sss-kd9md 3 жыл бұрын
@@pranjalrathod2158 rude? Who?
@pranjalrathod2158
@pranjalrathod2158 3 жыл бұрын
@@sss-kd9md that guy deleted the comment now. Let's ignore
@bhanuprasad4952
@bhanuprasad4952 3 жыл бұрын
My interviewer got impressed when I explained the way you explained. Dude you are a 💎.
@akshaymarch7
@akshaymarch7 3 жыл бұрын
Wohooo! ✌️😎
@vishnunarayanan7713
@vishnunarayanan7713 3 ай бұрын
For which role you applied?
@biltten5786
@biltten5786 4 жыл бұрын
Rest of the world : JS is hard and crazy Akshay : hold my green tea.
@AmrithMS
@AmrithMS 3 жыл бұрын
Hitesh: Hold my ice tea.
@Oldstoryhouse
@Oldstoryhouse 3 жыл бұрын
@@AmrithMS travery media....are u challenging me?
@coolspatula2458
@coolspatula2458 3 жыл бұрын
@@Oldstoryhouse the new Boston..... focking noobs
@shubhsharma19
@shubhsharma19 8 ай бұрын
javascript is the most beautiful language and typescript is legendary with those types
@NizamKhan-dx5kj
@NizamKhan-dx5kj 4 ай бұрын
​@@Oldstoryhousep
@ApintoAApintoA
@ApintoAApintoA 9 ай бұрын
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.
@akshaymarch7
@akshaymarch7 9 ай бұрын
Wish you the best, keep rising! 🚀
@akshaymarch7
@akshaymarch7 4 жыл бұрын
Next Video: setTimeout + Closures Interview Question 🔥 - kzbin.info/www/bejne/m3O3c3pqo8mUaKM Kaisa laga video? Are you feeling excited? Let me know in the comments below. ❤️
@AdarshSingh-qd6mq
@AdarshSingh-qd6mq 4 жыл бұрын
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...
@riteshranjan5313
@riteshranjan5313 4 жыл бұрын
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.
@prathamsinghal5261
@prathamsinghal5261 4 жыл бұрын
Jhakaas jhakaas jhakaas
@iamsarojb
@iamsarojb 4 жыл бұрын
Great. The way you teaching is Great.
@EeshaKPopDanceCovers
@EeshaKPopDanceCovers 4 жыл бұрын
Amazing and very detailed as always..😊😊
@ls0359
@ls0359 Жыл бұрын
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
@farazhusain925
@farazhusain925 3 жыл бұрын
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.
@mrankushtechnical
@mrankushtechnical 3 жыл бұрын
Wow😂 bro..
@akshaymarch7
@akshaymarch7 3 жыл бұрын
Congratulations, Faraz. You’re inspiration to many! ♥️
@farazhusain925
@farazhusain925 3 жыл бұрын
@@akshaymarch7 Thanks bro. I've joined that company on 6th September. Apart from that, I got one more offer as front-end developer.
@kishorburkul3368
@kishorburkul3368 3 жыл бұрын
@@farazhusain925 i m looking for job as front end developer can you help me how to find it
@Indiankarnataka
@Indiankarnataka 2 жыл бұрын
@@farazhusain925 I am also looking for job as front end developer recently I have completed HTML CSS and JavaScript presently i am learning reactjs
@ogs3721
@ogs3721 3 жыл бұрын
Four things I like about Akshay. 1) Doesn't try and speak in an American accent, like most Indian KZbin programmers. 2) Passionate 3) Someone with real knowledge. 4) A talented teacher.
@akshaymarch7
@akshaymarch7 3 жыл бұрын
Love you! ♥️
@isaacprosper6295
@isaacprosper6295 2 жыл бұрын
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
@prajjwal1010
@prajjwal1010 2 жыл бұрын
That's what make him unique!
@us-xf3kk
@us-xf3kk Жыл бұрын
you mean Hitesh choudhary ?
@sanjaygangwar2508
@sanjaygangwar2508 Жыл бұрын
@@us-xf3kk 🤣
@shikharjoshi6349
@shikharjoshi6349 4 жыл бұрын
Bhaiya is high on JS 😂. More power to you.
@97vaqasazeem
@97vaqasazeem 4 жыл бұрын
Haha !! So much passion for Javascript . Great !
@rupinkhandelwal
@rupinkhandelwal 4 жыл бұрын
Indeed! :D
@rupinkhandelwal
@rupinkhandelwal 4 жыл бұрын
Closures is another level
@HARIHaran-ks7wp
@HARIHaran-ks7wp 4 жыл бұрын
High on Javascript and green tea....Snoop Dogg no match xD
@KamranKhan-xv4br
@KamranKhan-xv4br 3 жыл бұрын
Exactly..
@narendrakumariitb
@narendrakumariitb 2 жыл бұрын
Man how can a student not be excited if the teacher himself is so so much excited. Great video bro
@ufuomapokoh413
@ufuomapokoh413 3 жыл бұрын
this dude makes me fall in love with JS. And, yes. i'll never have to find another video on closures. thanks a million!
@ddheena272
@ddheena272 50 минут бұрын
i feel the Same too in 2024 now.even though this video got 3 years old.i also feel the same .Let's GET DEEP DIVE INTO THIS.........................................
@veerendrajana6444
@veerendrajana6444 3 жыл бұрын
As a Mechanical Engineer, I'm really enjoying this course. The way you are explaining is simply superb.
@nikhil6842
@nikhil6842 4 жыл бұрын
One step closer to Closure. Thank you Akshay, I cleared my JS interview because of your videos only.
@akshaymarch7
@akshaymarch7 4 жыл бұрын
Congratulations, brother! ❤️
@simcard2732
@simcard2732 Жыл бұрын
I am beginner please give some tips
@gk4816
@gk4816 Жыл бұрын
@@akshaymarch7 comment testing
@AmmarTheTrainer
@AmmarTheTrainer Жыл бұрын
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.
@ssbrar
@ssbrar 3 жыл бұрын
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 .
@bharathsh9809
@bharathsh9809 2 жыл бұрын
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 ..
@toskr-r4t
@toskr-r4t 2 жыл бұрын
Another seriously underrated JS channel. Clear and simple explanation. Thank you Namaste :)
@flanshgajbhiye4259
@flanshgajbhiye4259 Жыл бұрын
can u tell us more underrated JS channels.
@Ella438
@Ella438 2 күн бұрын
Your content is gold. Everytime I need to brush up any concepts I go through the videos on your channel. You are awesome!!!!
@ruditrahul3638
@ruditrahul3638 3 жыл бұрын
Bhaiya, Please don't ever delete this playlist!!!..This is super helpful and helps me revise it before the interview!!!!
@jagrutsharma9150
@jagrutsharma9150 2 жыл бұрын
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.
@Sportgameww
@Sportgameww 3 ай бұрын
bro is everywhere Thank you for this notes.
@swapnil12123
@swapnil12123 2 жыл бұрын
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
@akshaymarch7 2 жыл бұрын
🚀🚀🚀
@SahilKumar-xz1xs
@SahilKumar-xz1xs Жыл бұрын
@@akshaymarch7 Checking nested comments on youtube
@MrMohfeez
@MrMohfeez 3 жыл бұрын
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.
@priyanshumishra7900
@priyanshumishra7900 3 жыл бұрын
Brooo never seen anyone teaching online with that excitement!!! This is soo good! the content and the learning :))
@jeannoelhonisch7037
@jeannoelhonisch7037 Жыл бұрын
These videos are amazing. Its the depth, the enthusiasm, the great explainations etc….
@vipulsinghthakur2514
@vipulsinghthakur2514 2 жыл бұрын
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.
@jeannoelhonisch7037
@jeannoelhonisch7037 Жыл бұрын
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
@prajjwalsahu793
@prajjwalsahu793 4 жыл бұрын
If the video would have been 3 hours long I would have seen it with full enthusiasm. Thanks Akshay sir. Keep posting.
@akshaymarch7
@akshaymarch7 4 жыл бұрын
❤️
@adinfinitum03
@adinfinitum03 11 ай бұрын
Studied JS from alot of resources but this man made me fall in love with it , a true guru 🙏🏻, just remarkable
@asifahmed6568
@asifahmed6568 3 жыл бұрын
Only Legends would Binge watch This series😎 #JS😘😀😁
@sagarshekhar6296
@sagarshekhar6296 8 ай бұрын
Mujhe Closure kisi aise hi passionate instructor se samjh aa sakta tha.....Thanks man
@kiruthigarani4850
@kiruthigarani4850 2 жыл бұрын
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. :)
@neerajatokekar1079
@neerajatokekar1079 2 жыл бұрын
Changing let to var will not work as var is 'function scoped' so we cannot access it outside the function.
@niloybarmon7975
@niloybarmon7975 28 күн бұрын
I am really exited to learn more and absolutely enjoying.
@shivam12326
@shivam12326 4 жыл бұрын
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.
@akshaymarch7
@akshaymarch7 4 жыл бұрын
Hahaha 😂 Ask her to subscribe for more drama. 😂
@youtubecodinggithub6145
@youtubecodinggithub6145 Жыл бұрын
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
@vijaykumarreddyalavala3713
@vijaykumarreddyalavala3713 4 жыл бұрын
Akshay Saini is on a mission to make all of us great at JS. Thank you so much man
@perryog2205
@perryog2205 2 жыл бұрын
FUNCTIONS=MISS UNIVERSE!! BTW LOVELY EXPLANATION
@KevinHoltabc
@KevinHoltabc 3 жыл бұрын
Really love your energy! Your content is really helping with my interviews!!
@KiranYadavOG
@KiranYadavOG 2 жыл бұрын
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!
@peterstrange1830
@peterstrange1830 3 жыл бұрын
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!
@sarveshkulkarni6287
@sarveshkulkarni6287 8 ай бұрын
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 !
@mainakmondal8691
@mainakmondal8691 4 жыл бұрын
Best video on CLOSURE...the energy level and the content🔥🔥🔥...thanks a lot..😎😎
@ranikontham8678
@ranikontham8678 2 ай бұрын
Oh my godd....I fell in love with his explanations of the closure concept. The way he explains the clouse concept was top notch😍
@peak-naik
@peak-naik 4 жыл бұрын
Damn bruh! It got aggressive real quick!!! Reminds me of that Maths teacher yelling at the screen 😂
@akshaymarch7
@akshaymarch7 4 жыл бұрын
Haha, that math teacher was my favorite. 😂
@shubhamjaiswal9314
@shubhamjaiswal9314 4 жыл бұрын
haha! bhut sahi
@absurdist1330
@absurdist1330 2 жыл бұрын
Probably the most concise explanation of closures. Awesome teaching!
@avantikasarkar3175
@avantikasarkar3175 2 жыл бұрын
You make complex topics feel like a "Hello World" program 🙏. You truly have a knack for teaching.
@mazharimam9216
@mazharimam9216 2 жыл бұрын
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 ❤️
@simrankoul
@simrankoul 4 жыл бұрын
I have nothing to do with JS, and yet I am watching this as if my life thrives upon it. Going great like always! 🤗🤗
@akshaymarch7
@akshaymarch7 4 жыл бұрын
Thank you so much, Simran 🤗
@aayushtyagi4916
@aayushtyagi4916 10 ай бұрын
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 🥰
@chrispusthiaine3735
@chrispusthiaine3735 2 жыл бұрын
Namasty Bro. I think you're impacting more knowledge than most schools🙏🙏🙏
@ashishdeora8522
@ashishdeora8522 2 жыл бұрын
Coding from last 11 years and never seen this beauty of JS. Thank you so so much 💖
@anupammanitripathi2731
@anupammanitripathi2731 4 жыл бұрын
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.
@Supercool7042
@Supercool7042 2 жыл бұрын
your energy while teaching is next level........
@shaileshparmar3973
@shaileshparmar3973 4 жыл бұрын
The excitement level is the dam high
@mohit96nain
@mohit96nain 4 жыл бұрын
I was looking for this comment, checking whether it mee or someone else also thinking the same 😂♥️
@shaileshparmar3973
@shaileshparmar3973 4 жыл бұрын
@@mohit96nain yo bro 🤣
@KamranKhan-xv4br
@KamranKhan-xv4br 3 жыл бұрын
@@mohit96nain mee too, thinking of it same 😅
@sreelekshmiunnikrishnan575
@sreelekshmiunnikrishnan575 8 ай бұрын
I am doing a full stack developer course online and my mentor suggested your videos.Your videos gave me a lot of new ideas and get to know javascript in depth.Thanks Akshay for your efforts 🙏
@shivashankar6043
@shivashankar6043 4 жыл бұрын
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 🙏...
@prafulsinghvit
@prafulsinghvit 4 жыл бұрын
JavaScript itself is vast, but yeah once he completes that...may be he can put a udemy course for React. 😀
@rupinkhandelwal
@rupinkhandelwal 4 жыл бұрын
That would be awesome!
@unknownworld4950
@unknownworld4950 3 жыл бұрын
Vote for reactjs :D
@CodeWithYubraj
@CodeWithYubraj 3 жыл бұрын
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.
@rashmitapinto4175
@rashmitapinto4175 2 жыл бұрын
Yes pleaseeee
@deepakbv636
@deepakbv636 9 ай бұрын
❤Function are so beautiful ❤ So elegant 🎉 Just looking like a wow 😂😅😊
@akarshsrivastava8890
@akarshsrivastava8890 4 жыл бұрын
Finally, today I can sleep peacefully. We won over closure after watching this video. 😅
@aravindhvasu195
@aravindhvasu195 Жыл бұрын
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.
@kirtikhohal5025
@kirtikhohal5025 Жыл бұрын
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.
@the-owls-owlet
@the-owls-owlet 4 жыл бұрын
I was waiting for this since long 😃 Today I will sleep well ✨
@samarpanharit4268
@samarpanharit4268 4 жыл бұрын
True.
@SatyendraSingh-mu2ux
@SatyendraSingh-mu2ux 4 жыл бұрын
Me2😀
@vinothkumarv9722
@vinothkumarv9722 4 жыл бұрын
Wow amazing bro....
@prafulsinghvit
@prafulsinghvit 4 жыл бұрын
Same here...!! Excited..!!!
@EstheticallyPathetic
@EstheticallyPathetic 6 ай бұрын
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 ♥
@technicalbhai235
@technicalbhai235 4 жыл бұрын
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
@akshaymarch7
@akshaymarch7 4 жыл бұрын
All of these are coming!! 💥
@Makeyourselfproud22
@Makeyourselfproud22 3 жыл бұрын
@@akshaymarch7 we are waiting for these topics
@mathanprakash5685
@mathanprakash5685 3 жыл бұрын
@@akshaymarch7 i am also eagerly waiting for those topics
@kalavathithiyagarajan8994
@kalavathithiyagarajan8994 2 жыл бұрын
@@akshaymarch7 waiting please upload the videos as soon as possible plz bro
@nicholasaine7756
@nicholasaine7756 2 жыл бұрын
@Akshay Sani . Waiting for these too :)
@guruprasadsali7402
@guruprasadsali7402 3 жыл бұрын
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
@allaboutev6360
@allaboutev6360 2 жыл бұрын
I have watched 1000 videos before this and i can guarantee you i will not watch again any video of closure again . Thanks Akshay
@mohit7717
@mohit7717 6 ай бұрын
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 ❤
@anshikapathak4422
@anshikapathak4422 2 жыл бұрын
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.🙏🙏🙏🙏🙌🙌🙌🙌🙌❤️❤️❤️🎉
@jotarokujo312
@jotarokujo312 Ай бұрын
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!
@ayushipriya3884
@ayushipriya3884 3 жыл бұрын
Getting to learn a lot. Thank you so much for sharing your knowledge . This course is helping me a lot.
@manjunathadharagond9322
@manjunathadharagond9322 2 жыл бұрын
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!!
@vinothkumarv9722
@vinothkumarv9722 4 жыл бұрын
Vinoth love❤️ >> Akshay: One thing i forgot to inform bro dress code And hairstyle is awesome And finally End music is Vera level :)
@rishabhkalra9505
@rishabhkalra9505 3 жыл бұрын
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
@rhimanshu6288
@rhimanshu6288 4 жыл бұрын
"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??
@DurgeshYadav-bc5nm
@DurgeshYadav-bc5nm 3 жыл бұрын
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
@VishalGupta510
@VishalGupta510 4 жыл бұрын
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.
@biltten5786
@biltten5786 4 жыл бұрын
Nice point
@divyanshgupta5118
@divyanshgupta5118 2 жыл бұрын
Yesterday I explained Closure and Hoisting in an interview thanks to you Akshay
@vgcordys
@vgcordys 3 жыл бұрын
Chitvan(Hope you know the legend): Baba, you are beautiful Akshay: JavaScript, you are beautiful 😃
@samyakshah9119
@samyakshah9119 Жыл бұрын
Having teacher like Akshay Sir is a blessing!
@vikramjha4593
@vikramjha4593 Жыл бұрын
Hey bro, is there any difference between lexical scope and lexical environment ?
@himanshu5ingh
@himanshu5ingh Жыл бұрын
@@vikramjha4593 lexical environment is a combination of local memory and the lexical environment of its parent(lexical means sequence like grandfather> father>child>grandchild). lexical scope is also called static scope which means a variable defined out of a function can be accessible inside the other function defined after the variable declaration(for example:- on your grandfather property is your father property and your father property is your property but your property is only your property that means inner function can access value from outer function but outer function can't access value from inner function.)
@aayushipandey7292
@aayushipandey7292 4 жыл бұрын
He literally treats people who learn other languages as aliens! :D Indeed JS is beautiful.
@akshaymarch7
@akshaymarch7 4 жыл бұрын
I love Aliens. ❤️
@currentadda7884
@currentadda7884 4 жыл бұрын
@@akshaymarch7 i love AYushi
@HARIHaran-ks7wp
@HARIHaran-ks7wp 4 жыл бұрын
@@currentadda7884 bhai chill lol
@raxitlakhatariya5915
@raxitlakhatariya5915 2 жыл бұрын
Prior to this video, I was expecting closure a rocket science, but Akshay made it so simple. Just amazing
@0xFOXHOUND
@0xFOXHOUND 4 жыл бұрын
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 : kzbin.info/www/bejne/bWXLcmmHbNuDf5Y 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
@pekalarajesh6147 Жыл бұрын
@0xFOXHOUND hello bro can u please explain me why we got the value as 100...not 7 at 13:30
@ajinkyavidwans4134
@ajinkyavidwans4134 Жыл бұрын
@@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'.
@chenshen4255
@chenshen4255 Жыл бұрын
Man!!! I like how you are passionate about closure, I wasn't planning to watch the next video, but I will now
@thriftykapila8420
@thriftykapila8420 4 жыл бұрын
Me (30 mins before interview) - Note that, note that!!!
@denisveli9465
@denisveli9465 2 жыл бұрын
You're the best JavaScript teacher alive.
@ramraghunathan947
@ramraghunathan947 3 жыл бұрын
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 🥳🥳🥳
@rafaXD05
@rafaXD05 3 жыл бұрын
hahha
@mrankushtechnical
@mrankushtechnical 3 жыл бұрын
Hahaha😂😂
@nikhildeepsingh2832
@nikhildeepsingh2832 Жыл бұрын
A function along with its lexical environment forms a closure. Lexical scope means the references that function was associated with, which means that whenever a function forms a closure it is bound to remember the references it was created with initially(the part in the code where it is called does not matters in case of closures )
@outzonegaming4554
@outzonegaming4554 4 жыл бұрын
Dude, nice hairstyle and video.
@Ganesh-ld8ph
@Ganesh-ld8ph 11 ай бұрын
functions are so beautiful so elegant just work like a wow.... 😍🤩
@nerdycap7513
@nerdycap7513 3 жыл бұрын
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!
@simple8810
@simple8810 3 жыл бұрын
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
@cb559
@cb559 3 жыл бұрын
Senior and cool developers disliked the video because they still didnt get it !
@akarshjaiswal1622
@akarshjaiswal1622 3 жыл бұрын
😅
@chrisbanas9118
@chrisbanas9118 2 жыл бұрын
This is genuinely the best video I have ever seen
@AmanMishra-pn3cq
@AmanMishra-pn3cq 2 жыл бұрын
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.
@mujamil87
@mujamil87 Жыл бұрын
I am learning Javascript for Test automation and I am really happy to learn it from basics and how its works internally.
@Prakhar281993
@Prakhar281993 4 жыл бұрын
1:30 you sounded like Arnab Goswamy
@akshaymarch7
@akshaymarch7 4 жыл бұрын
Hahaha 😂 😂
@mudassirahmed6220
@mudassirahmed6220 2 жыл бұрын
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,
@rohil3023
@rohil3023 4 жыл бұрын
10:45 😂😂😂😂😂
@akshaymarch7
@akshaymarch7 4 жыл бұрын
Hahaha 😂
@AkashPatel-hc8zu
@AkashPatel-hc8zu 2 жыл бұрын
So many years with JS. And here I am feeling like dumb and enjoying each and every bit.
@sanathkumar1698
@sanathkumar1698 3 жыл бұрын
17:05 : "If I call my x" Bruh been calling her ,she doesn't pick up, what to do😭😭
@naveenjaiswal2894
@naveenjaiswal2894 3 жыл бұрын
hahahha
@LittleChan
@LittleChan 2 жыл бұрын
Best teacher on youtube! Wondering why he isnt uploading anything anymore
@Kirti-bi2yj
@Kirti-bi2yj Ай бұрын
When he said : - "x is gone, it's no longer there, it does not exist." - We all felt that. lolll😅
@anuraggarg7180
@anuraggarg7180 7 күн бұрын
😅LOL
@Abhishek-ko8bf
@Abhishek-ko8bf 3 жыл бұрын
You are diamond 💎 sir with no doubt .continue this way teaching .I never boarded with your series
How to have fun with a child 🤣 Food wrap frame! #shorts
0:21
BadaBOOM!
Рет қаралды 17 МЛН
Challenging Mental Models and Unconscious Biases in 2024
9:06
The Dome Paradox: A Loophole in Newton's Laws
22:59
Up and Atom
Рет қаралды 723 М.
CRAZY JS INTERVIEW 🤯ft. Closures | Namaste 🙏 JavaScript Ep. 12
32:45
How To Focus On The Right Problems
16:57
Y Combinator
Рет қаралды 30 М.
Math Olympiad Problem | Geendle
12:46
Geendle
Рет қаралды 169