Next Video: First-Class Functions in JavaScript 🔥- kzbin.info/www/bejne/iXmsf6J-rduHqdE Timestamps for this video: 00:26 - What is a Closure in JavaScript? 01:34 - Can you give an example of a Closure in JS? 03:29 - Use of double parenthesis ()() in JS 05:25 - Are Let declarations closed over? 06:15 - Are function parameters closed over? 07:45 - Relation of Scope Chain and Closures 10:25 - Conflicting name Global variables in JS 13:25 - Advantages of Closure 14:24 - Data Hiding & Encapsulation in JavaScript? 14:59 - Example of Data Privacy using Closures 21:10 - Function Constructor in JavaScript 25:02 - Disadvantages of Closures? 26:02 - What is a Garbage Collector in JavaScript? 27:25 - Relation between Garbage Collection, Memory Leaks, and Closures? 29:42 - Example of Smart Garbage collection by V8 JS Engine in Chrome 32:00 - Result of the Crazy JS Interview 32:10 - Thank you for watching Namaste JavaScript 🙏 How confident are you with Closures after watching this video. Please tell me in the comments, I read each comment. ❤️
@ravikumarkamble64034 жыл бұрын
This man is the godfather of js.🤩
@bluefury1184 жыл бұрын
hello there, 16 year old here...love your vids!
@akshaymarch74 жыл бұрын
@@ravikumarkamble6403 Haha 😂
@akshaymarch74 жыл бұрын
@@bluefury118 Wow, you're a champ!! 🙏
@RahulBhammarker4 жыл бұрын
at 5:13 I was litearly screaming Hoisting 😂😂 good job, I am subscriber straighy away ❤️
@2bitsbyab3 жыл бұрын
What an interview, not just split screen, split personalities 🔥🙇
@Exploringlife-dq8gt2 жыл бұрын
Jokes apart...must appreciate the effort bro...
@dhananjayarora5765 Жыл бұрын
May be he is a part time actor. Lol
@emmetsingh Жыл бұрын
His alter personality as interviewer scares himself. Unreal 😂
@syedhassanraza66057 ай бұрын
@@emmetsingh A good teacher is, at the same time, a goog actor.
@jagrutsharma91502 жыл бұрын
Things learned: 1. An inner function can be directly called using two parenthesis ()(). 2. Even parameters can be passed this way (Remember that the function needs to be returned to do this) 3. Closures can also be used for data hiding and encapsulation. So other code cannot access this value. 4. Unused variables are automatically deleted in High Level Programming language by garbage collector. Closures allocate a lot of memory which cannot be deleted so this acts as a disadvantage. 5. Some browsers now have smart garbage collectors that automatically deletes variables that are not used outside closures.
@dddddeeeevvvvvv2 жыл бұрын
thanks for key points. (also small world 😅)
@amsemity17922 жыл бұрын
Yes...return is must ...in that sense return is actually what forms closure i think...without return closure can't be formed and no variable can access its value from parent..am i correct
@jagrutsharma91502 жыл бұрын
@@amsemity1792 Yes since the function is returned, that's the reason closure is formed. The inner function that is returned is able to access the outer function variables.
@eashan2405 Жыл бұрын
@@jagrutsharma9150 But why is counter2() printing starting from 1? It should print 3 since counter1() is already called twice before.
@jagrutsharma9150 Жыл бұрын
@@eashan2405 Due to closures. The moment counter2 is created => a new incrementCounter function is stored in counter2 different from counter 1 and hence the count in both are different. There are two closures formed now. One for counter1 and another for counter2.
@shashikanthp31454 жыл бұрын
This should've taken so long to make.. - First he needs to write a script - Calculate the time he needs to say each dialogue for proper co-ordination - Dress up as 2 different people and shoot the video - Properly edit the video to make sure it doesn't feel like the same person - Upon that there will be a lot of bloopers we didn't see It probably took him whole day. Fantastic job Akshay 👏
@QiroLab4 жыл бұрын
wow, that is really a lot of work. At first, I thought both are different persons. After watching 5min, both look similar, and after reading comments that is confirm both are the same person. Fantastic job Akshay 👏
@anuragsinha29634 жыл бұрын
Add "Tying a ponytail" to the list :D
@poonampoonam3053 жыл бұрын
both are same?
@chandreshyadav98463 жыл бұрын
@@poonampoonam305 Yes
@sanetiger36543 жыл бұрын
Well someone or something is reciting the other person's script and he is going with the flow and then act out the script by himself watching his video easy but yeah takes some effort.
@manjunathbabu66092 жыл бұрын
Let us take a moment to appreciate the amount of time and efforts put to create this masterpiece. #respect
@lakshmana618 Жыл бұрын
you hit the ball out of the park with this video, this is not just a mock interview but a postmortem of closures, got so much insight along with entertainment, thank you so much, keep enlightening and entertaining us
@GareebScientist4 жыл бұрын
Took me a while to realise it's you on both sides. I was hunting description to see who the other guy is 😂😂
@akshaymarch74 жыл бұрын
Hahaha 😂
@GareebScientist4 жыл бұрын
@@akshaymarch7 great job man ❤️
@nemotivity4 жыл бұрын
I was thinking the interviewer is techsith!! 😅
@romanmandal62784 жыл бұрын
heyyy ...i watch ur videos too...
@ShrinivasKattimani664 жыл бұрын
@@nemotivity I too...
@robertbarrowfarrisiii25623 жыл бұрын
Bro this is absolute gold how did you pretend to be nervous interviewing yourself hahahahahhaha.... Acting, Video, The Mole, everything gets an A plus. Subscribed
@kalyansreekarjhade29442 жыл бұрын
Wtf. I didn't know that the interviewer was Akshay until I saw this comment.😂
@nikhilthakur50892 жыл бұрын
@@kalyansreekarjhade2944 konsa nasha bhai?
@sumitsahu86572 жыл бұрын
@@nikhilthakur5089 🤣🤣
@WestcolColombia_2 жыл бұрын
@@kalyansreekarjhade2944 hahahaha me neither, for reak
@aniketfunde71882 жыл бұрын
Mole 😂😂🔥
@RahulGupta-km7nm3 жыл бұрын
After 6 years of experience, I have realized how deep and beautiful the closure is. At this level, I haven't even think of it. Really great work. Expecting more. You are a JS hero.🙂
@sameersahu45692 жыл бұрын
From a creator perspective how hard it must have been....like presenting all the stuffs in a organized manner and attention to detail.....it was literally on point......Thank you for your efforts Sir.
@saurabhandhare21182 жыл бұрын
Watching this excellent series after 1.5 years from the time it was uploaded. Let me tell you I have never felt the super powers of Javascript before this, Hatts off 🔥
@awaisyusuf1847 Жыл бұрын
After 2 years
@souravkumar-hl2ot Жыл бұрын
After 3 yrs
@nivikasvlogs22134 жыл бұрын
I never thought that someone will make learning so entertaining😂 hats off to you bro🙏 you are saviour for web developers 👍
@ImproveProgrammingLogic4 жыл бұрын
Correct
@VikramKumar-yo6nm3 жыл бұрын
no doubt👏
@haribabupoturaju4 жыл бұрын
The interviewer Looks like Villain in old movies, but in Reality he is a Super Man and Sakthi Man. You are fantasitccccccc and You made my day brother . More power to you Brother.
@akshaymarch74 жыл бұрын
Hahaha 😅
@dmkjava3 жыл бұрын
hahaha ha ah aha ha ah haa haa
@prashanttanwar32614 жыл бұрын
This namastey javascript series is going to make many folks get a good job
@talwinter3 жыл бұрын
What caught my eye was the passion that you put into it. You can see that you REALLY want your viewers to learn and not just spill your knowledge out.
@laurentgauthier87423 жыл бұрын
Wow! This is a HIGHER ORDER tuto! Thank you so very much for it! This scenario really allows to understand all of the previous videos of the series in action. PLUS, you give more examples to better understand. PLUS you begin to explain the relevance of closures to get behaviours seeked when using classes, private variables and methods to access those hidden attributes... PLUS you kind of show how all of this is related to the functional programming paradigm with the impossibility to access the inner workings of the function while interacting with it only through functions... I would love so much if you did videos on functional programming and its uses in the industry! This 12th episode leaves me in awe... Again, THANK YOU for this content!
@PriyankaKumari-qs2ht3 жыл бұрын
You know the best part was that while you were portraying the candidate side you have same level of confidence +nervousness which we all face and hile you were portrayong the interviewer part you were as confident as interviewers normally are.👏👏
@chetannimbalkar18534 жыл бұрын
2 min of silence for those who thought they are different persons
@shashikanthp31454 жыл бұрын
Do you think people are actually THAT dumb ?
@46divyajeetsingh4 жыл бұрын
@@shashikanthp3145 Yes, I am that dumb.
@shashikanthp31454 жыл бұрын
@@46divyajeetsingh 😂😂 really ? Are you a new subscriber ?
@46divyajeetsingh4 жыл бұрын
@@shashikanthp3145 yes
@TheCodingOdyssey4 жыл бұрын
ha ha dying lol!
@theaveragecoder61823 жыл бұрын
That little nervousness in the interviewee voice and the strict and confident tone of the interviewer explains that he is a great actor as well 😆
@Gunaavi33310 ай бұрын
The interviewee did a fantastic job. I can see the uncertainty, fear and anxiety on his face. Perfectly recreated the interview scenario. Kudos
@kiranjitkaur69253 жыл бұрын
Wow !!..what an awesome video and content...This is probably best video on closures on internet and Akshay is a good actor too ! His JS series is world class !
@akshaymarch73 жыл бұрын
Thank you, this comment made my day 😍❤️
@saurabhjaswal213 жыл бұрын
At last, when you say that I've learned from Namaste Javascript, this same thing happened to me yesterday and you know what is the best thing my interviewer also watched this series. Even if I don't get the job but the kind of confidence which I got is humongous. Thank you so much, Man!!
@shubhamchoudhary84144 жыл бұрын
Ok now this is called "True Innovation". Making people understand the concepts by showing them both the sides of the coin. Truly "One Of a Kind" video, absolutely loved every second of it and will definetly help me in my next inteview. @Akshay Saini is a LENGEND ❤️
@nagenderrajput54063 жыл бұрын
LEGEND*
@TravellWithAkhil2 жыл бұрын
Clash of interviewer and candidates Both came from Namastey JavaScript episodes 😀 They formed closures 💕
@being_ashhar9 ай бұрын
Teachings apart, your acting as an interviewee was superb! Also, many concepts cleared through this technique! Thanks man. Hope I get this thing in the Namaste React too!
@naeemshaikh50474 жыл бұрын
The interview process was so real, the interviewee grew in confidence with passage of time.HatsOff
@akshaymarch74 жыл бұрын
I tried to create an actual interview scenario. Glad you liked it 😇
@ayushaggarwal76904 жыл бұрын
Holy crap, that's some next level content 😂😂
@ImproveProgrammingLogic4 жыл бұрын
Right..
@tanyamehrotra88324 жыл бұрын
cannot believe I'm watching this on a Saturday night instead of Netflix. Keep them coming! Your content is amazing :)
@shourya98983 жыл бұрын
Wtf! Same
@sagargadekar60883 жыл бұрын
sun night at 0.19am :D
@chromashift3 жыл бұрын
I'd pay to watch you kill a Web3 series! You're ability to sustain engagement, especially for someone with clinically diagnosed ADHD - phenomenal! As in you've helped actually begin to understand code, & be able to read it like a book.
@Devaansh2K235 ай бұрын
bhai this deserves more views . the student spoke just how regular engineering students respond in their vivas. DOPE🔥🔥🔥
@yashshuklaphotography3 жыл бұрын
Interview with flawless internet connectivity.
@kumarshubham70173 жыл бұрын
And also flawless camera quality :D
@AvikNayak_9 ай бұрын
@@kumarshubham7017 also flawless audio quality
@ramanansivagnanam42854 жыл бұрын
This is why i am eagerly following LinkedIn akashy bro !!..from entertainment videos to javascript concepts...This is what new india will be..jai hind
@simrankoul4 жыл бұрын
NamasteJS >>>>> Netflix Loved this one. ❤
@ankit_9125 Жыл бұрын
जग घूमेया थारे जैसा ना कोई 🙌🙌
@VaishnaviNigam2 жыл бұрын
Cant resist commenting on this........A MasterPiece by a MasterPiece...PURE GOLD 🔥🙌❤
@priyajain67913 жыл бұрын
I wish this video was uploaded before I appeared for the interviews last 1.5 month back 😓. If there is any 4th adjective degree after 'BEST', even that would be less to describe how awesome this video is!! Kudos to your efforts and thanks a ton 🙏🙏 Might come handy in my next interview process in few years again 😂
@UdayKumar-gu2sg Жыл бұрын
Heyy are you working now?
@rishabhsharma46543 жыл бұрын
The interviewer acting of yours is Scary as hell, a person very calm and also asking penetrating questions.
@divyansh22122 жыл бұрын
Never seen this type of educational video before! Mind Blowing! 🙇🙏
@damiancardozodelgado21013 жыл бұрын
Man ... you are a great communicator, the way you make topics that are usually boring out of complexity, fun , is really great value for the community, ty sir, continue the good work
@bhuvandixit674 Жыл бұрын
While watching this video I was thinking how much effort you have put into this series and specially this video. Hats off to you.
@sonalshahare35212 жыл бұрын
He is amazing dude. He had made learning so easy and entertaining, Colleges need this type professors, mentors.
@nitishr14643 жыл бұрын
Going in depth, showing all possible follow up questions, while keeping it interesting at the same time, it is difficult to find such content. You are a gem brother. Keep it up!
@malachynwafor5665 Жыл бұрын
Wow, this has to be the best coding video tutorial I've watched. So much information passed in a very creative and intuitive way that'll definitely enable the information to stick to one's memory. I have to commend the effort put into this video and I'm very excited to rewatch as many times as I have to
@pankhurigandhi625Ай бұрын
No words to appreciate how beautifully explained the concepts are...just paused the video and came to comment. The efforts are truly commendable.
@rohinikoul23394 жыл бұрын
Who wants Netflix series when we have Namaste JS. Next level teaching
@prithvisinh3 жыл бұрын
This is brilliant. Closure was never explained so nicely before.
@user-mz7qm5ob5f Жыл бұрын
Nobody can beat you in closure...Amazing video big fan.....🙏
@pradeepkumar-dw8qf3 ай бұрын
You Actually explained what smart garbage collection is with an example. THAT WAS EPIC!!! Your teaching style is beautiful! ❤
@conanimation7 ай бұрын
took me 7 mins to notice that both are same people nice video got a lot of doubts cleared
@sushant_Tapzo2 жыл бұрын
Great men extremely helpful 🔥🔥😍❤️
@tabrezdn14 жыл бұрын
I must say the amount of effort you put in your videos is amazing. Like the candidate being a bit nervous and the interviewer being careful observer. Big fan ❤️🔥🔥🔥
@akshaymarch74 жыл бұрын
Wow, glad you noticed. I intentionally tried to act like that. 😅 Thank you so much for your comment, love you brother! ❤️
@tabrezdn14 жыл бұрын
@@akshaymarch7 Thankyou and I hope your channel reach more audience. Big fan of the series Namaste JS💖. BTW a quick question out of curiosity - in the video which part was shot first? The interviewer or the candidate. 😀
@akshaymarch74 жыл бұрын
@@tabrezdn1 The Candidate. 😁
@rushabhdave66483 жыл бұрын
Best teacher award goes to Saini Sahab 🎉🎉❤️
@abhaygupta7347 Жыл бұрын
I really like the way everytime the candidate answer, he says a new term and interviewer asked the same question, it like you deciding what the interviewer should ask.. Excellent 💯
@SuryaKarigar2 жыл бұрын
One of my friends shared the link as I've just fallen into JavaScript. He said it will clear all your basic doubts and you'll learn much more. But this series will be of this kind? Never imagined that. There are a lot of programmers out there but your enthusiasm is what I look for. Not just to write code but the time and effort to find the root cause of its working. Hatts of SIR 😍😍😍😍
@amaan0 Жыл бұрын
Throughout the whole video I was wondering how you synced both the interviewer and interviewee. Hats off to you sir. NJs ❤🔥
@indiansoftwareengineer48994 жыл бұрын
This happens when Creativity meets Knowledge, dope nice video .... loved it...
@ravivarma58733 жыл бұрын
Manh! I felt anxiety whenever this interviewer asks a question
@priyadarshtiwari34512 жыл бұрын
A guy with good knowledge and a good heart. Hats off men
@brainstormx47912 жыл бұрын
Bro u r something that this world needs!! u did the interviewer part as well as interviewee part with exact same behaviour man!! and man explanantion to these topics are way easier to understand, ive never thought so earlier. YOU ARE A LIFE SAVING !!!!
@ravivarma-ur4vi4 жыл бұрын
Thats really awesome. Quick revision of core concepts. we expect the same overall concepts for React and Angular as well.
@harshithvenkatesh20534 жыл бұрын
Beautiful interview, I am sure if asked in interview, I will definitely say namaste javascript❤❤❤❤❤
@lovetyagi2774 жыл бұрын
Akshay next level content representation. Content is too good.
@mdridoy-ef2pw2 жыл бұрын
I love how the interviewer sometimes act like he doesn't care what Akshay is saying but when the answer is finished he immediately follows up with even deeper question on the topic.
@Yadnesh_017 ай бұрын
Oh my god such a mind-boggling interview ❤
@mearn_ctaftsman2 жыл бұрын
I was really impressed with the last question : Where did you learn all this stuff with your answer 😅🤣😂
@delmayank4 жыл бұрын
A zillion congrats. I don’t know why people waste time on carryminati.
@kalyanipriyadarsini3 жыл бұрын
Because all aren't programmers
@partyhouse10243 жыл бұрын
Bhai mt bol warna yaha bhi dislike ki history bana denge log
@abhijiths1483 жыл бұрын
Lol so true 🔥😂😂😂
@asifahmadahmad613 жыл бұрын
Because carry has roasting and entertaining domain. Don't tell me, you code 24*7. you do enjoy other things too.
@ratul_hasan_rahat3 жыл бұрын
Open up your mind. Your so closed.
@shakshamsinha38854 жыл бұрын
The best thing About this interview was that it felt real
@theprotagonist39062 жыл бұрын
I first watched it 2 years ago when I was preparing for an interview and am now again doing a revision for my next job interview.
@rizwans69322 күн бұрын
I am started in dec 2024,its really fun of learning js with you 🤩,thank a lot
@sagarjain41283 жыл бұрын
Laughing on your own Dialogue "Lets call it OUTEST" was funny as well as humorous as this way you are creating two distinct personalities of your own 😃😃😂😎😎😎😎😎
@tomriddle30423 жыл бұрын
I was thinking all the time it was a genuine interview and they both are different person.. but when he removed his glasses 6:53 tab mene dekha saala gangadhar hi shaktiman hai! 😆
@milanvala79403 жыл бұрын
hahahaha
@sannihitasn9083 жыл бұрын
31:44 Akshay being impressing by Akshay 😂😂 This was some dope content!! 👏👏 Thank you!!
@singhkr Жыл бұрын
just to record a simple video it took me 1 hrs I can't imagine how much hard work you have put for this video thanks again Akshay♥♥♥♥♥
@digital.voyager4 ай бұрын
Learned it!! Loved it!!
@krishnachaitanya81944 жыл бұрын
Bro you have a hidden actor in you 😂🤣
@kalyantelugutraveller77234 жыл бұрын
True
@Kiran-Shirageri4 жыл бұрын
😅
@ImproveProgrammingLogic4 жыл бұрын
Right..
@Mona001-01g4 жыл бұрын
Hahaha, these comments helped me understand that the interviewer was himself. I was wondering why the interviewer had such a snobbish attitude😂
@jaideepsah15303 жыл бұрын
I liked that interviewer part when he was cleaning the specs 🤓🤣🤣🤣 anyways thanks a lot for explaining in these much of details.
@sleep-4043 жыл бұрын
what the..... I was getting nervous whenever the interviewer was asking questions, DANG IT !!!!
@nehabhargava4 жыл бұрын
This is really fresh content and a cool way to demonstrate an interview scenario. Ps: This interviewer is giving me thug vibes 😎 , especially with that mole 😂
@akshaymarch74 жыл бұрын
Hahaha, interviewer is the real OP. 😎
@nehabhargava4 жыл бұрын
@@akshaymarch7 haha 😂
@JackLeiLing2 жыл бұрын
It is so fun to watch this interview drama. Looks so real! Learnt closure inside out from you in a super fun way. Amazing JavaScript ⭐️
@himanshurawat30482 жыл бұрын
its just blew away my mind the way u acted both the sides, acting of listening and understanding from interviewer side , the feel, vibe of both side , assome bhaiya, just hats off to you bhaiya!!!!
@akhilvaidya48192 жыл бұрын
Akshay, appreciate the amount of effort that must have gone into making this mock interview. Thanks a ton!! 💙
@anantanujdey36424 жыл бұрын
The mark on the interviewer.. I was cleaning my screen but then realized.. Haha
@akshaymarch74 жыл бұрын
Hahaha 😂
@vinothkumarv97224 жыл бұрын
It's another version of akshay bro....❤️🙏👍
@simple88104 жыл бұрын
hahahahhahahahahahhah trust me i was thinking there are actullay 2 diff friends
@vinothkumarv97224 жыл бұрын
@@simple8810 awesome....bro akshay did and doing well intraction...Always
@hiteshgrover22123 жыл бұрын
Relating the expressions whenever a new question is asked 😂😂
@nikhilthakur50892 жыл бұрын
I liked when you answered to yourself by seeing in the second screen bro ..
@AshishKumar-c6u3l11 ай бұрын
It's just amazing ! Can't find this knowledge anywhere. I failed lot of js interviews due to this concept but not anymore. Thanks alot for your effort.
@sameeppunjani74822 жыл бұрын
MAAAZA AYA IN RAHUL GANDHI STYLE YE MAAAZA HR CODER KO MILNA CHAHIYE lot's of hard work put in by you.
@veersingh-bv9bz2 жыл бұрын
Please Akshay sir please continue this series. It's been 1 year please sir continue it 🙏🏻🙏🏻
@shuntz79864 жыл бұрын
Honestly speaking at times I felt like the Interviewer knew less than the guy getting interviewed.
@solmindaudy4 жыл бұрын
Both are same bro :P
@mayur_madhwani032 жыл бұрын
Advantages of closures Closures are very useful Closures are very important Closures are so useful that makes them very important Closures are so important that's why they are used at alot of places That's me writing in RGPV exam😂
@vikashtiwari9202 Жыл бұрын
Same same bro 😂😂😂😂😂
@MOHD_JUNAID_19 Жыл бұрын
That dress code, that background, that shadow of running fan, that tone of asking questions...lit🔥
@rishiraj25482 жыл бұрын
Wow, Akshay! You taught me JS Closure in first place. With this video. Gratitude!🙏👍💯
@sadhlife3 жыл бұрын
You as an interviewer, laughing at your own joke "let's call this function outest" 🤣
@renugupta59853 жыл бұрын
SO the last question 'from where did you learn all this' was in my mind since beginning of this video. But Akshay I really want to know from where should I learn JS to get all such deep dives.
@PriyankaKumari-qs2ht3 жыл бұрын
I guess it always comes from learning a particular topic through multiple source(never forget the official doc)+curiosity(what will be the output if I do this and that).
@aamirjamal68334 жыл бұрын
For a second there, looking at the thumbnail, I thought you did a collab with tech sith..😂
@ManpreetSingh-vx8ur5 ай бұрын
Brilliant brother, you got a knack!!!, to teach the people in their way/ understanding. Thank you for this!!!
@HimanshuChauhan-f2v6 ай бұрын
even after so smart and deep answers not a single smile on interviewer's face
@tentx6523 жыл бұрын
epic answer for the question " where did u study all these closures " 😂😂 akshay saini from youtube 😂😂
@rahulchauhan1442 жыл бұрын
we know BB ki Vines. Now, we also know Akshay ki Vines :P
@rajkamalsingh47283 жыл бұрын
For giving the feel of connectivity issue you add slowmo in some parts I am right By the way closures are dead after this video 😂😂
@akshaymarch73 жыл бұрын
Hahaha 😁😂
@krishnavishwakarma83602 жыл бұрын
I've never ever understand what closures are, like you teach man. I'm just amazed and so so hats off to you for this series. Keep it up! Lots of love!
@saurabhpatil85733 жыл бұрын
Video was great in respect to the deep questions and concepts. But the way you demonstrated the interviewer and his actions like checking his watch and adjusting his hairs. Those things were awesome.