CRAZY JS INTERVIEW 🤯ft. Closures | Namaste 🙏 JavaScript Ep. 12
A JavaScript Interview covering in-depth QnA of closures, Data Hiding, Encapsulation, Function Constructors, Garbage Collector, Memory Leaks, Data Privacy with nitty-gritty details along with advantages, and disadvantages of Closure with a lot of code examples.
This is basically the third part of the videos covering the Closures topic in-depth end to end.
The previous 2 videos already released are:
0. Closures in JS - Namaste JavaScript Episode 10
1. Most asked setTimeout + Closures Interview question - Episode 11
2. This video above ☝🏽- Episode 12
These 3 videos will build a strong foundation of the Closures topic in your head, for a LIFETIME.
The only request is to watch this Episode of Namaste JavaScript with the utmost attention. 🙏
Topics Covered:
00:00 - Teaser - The Crazy Interview
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 🙏
Support this video series, NOT BY MONEY, but by sharing it with your friends. 🙏
I'll give my best to come up with great content and everything absolutely for free on KZread. 😊
If you are active on Social Media,
please give a shoutout to Namaste JavaScript and help me reach more people. 🙏
Cheers,
Akshay Saini
akshaysaini.in
Would love to Stay Connected with you ❤️
LinkedIn - / akshaymarch7
Instagram - / akshaymarch7
Twitter - / akshaymarch7
Facebook - / akshaymarch7
#NamasteJS #AkshaySaini
Пікірлер: 2 100
Next Video: First-Class Functions in JavaScript 🔥- kzread.info/dash/bejne/hXx9sNGBqNm6o9I.html 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. ❤️
@ravikumarkamble6403
3 жыл бұрын
This man is the godfather of js.🤩
@bluefury118
3 жыл бұрын
hello there, 16 year old here...love your vids!
@akshaymarch7
3 жыл бұрын
@@ravikumarkamble6403 Haha 😂
@akshaymarch7
3 жыл бұрын
@@bluefury118 Wow, you're a champ!! 🙏
@RahulBhammarker
3 жыл бұрын
at 5:13 I was litearly screaming Hoisting 😂😂 good job, I am subscriber straighy away ❤️
What an interview, not just split screen, split personalities 🔥🙇
@Exploringlife-dq8gt
Жыл бұрын
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 😂
@syedhassanraza6605
Ай бұрын
@@emmetsingh A good teacher is, at the same time, a goog actor.
Took me a while to realise it's you on both sides. I was hunting description to see who the other guy is 😂😂
@akshaymarch7
3 жыл бұрын
Hahaha 😂
@GareebScientist
3 жыл бұрын
@@akshaymarch7 great job man ❤️
@nemotivity
3 жыл бұрын
I was thinking the interviewer is techsith!! 😅
@romanmandal6278
3 жыл бұрын
heyyy ...i watch ur videos too...
@ShrinivasKattimani66
3 жыл бұрын
@@nemotivity I too...
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.
@dddddeeeevvvvvv
Жыл бұрын
thanks for key points. (also small world 😅)
@amsemity1792
Жыл бұрын
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
@jagrutsharma9150
Жыл бұрын
@@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.
Let us take a moment to appreciate the amount of time and efforts put to create this masterpiece. #respect
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 👏
@QiroLab
3 жыл бұрын
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 👏
@anuragsinha2963
3 жыл бұрын
Add "Tying a ponytail" to the list :D
@poonampoonam305
3 жыл бұрын
both are same?
@chandreshyadav9846
2 жыл бұрын
@@poonampoonam305 Yes
@sanetiger3654
2 жыл бұрын
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.
I never thought that someone will make learning so entertaining😂 hats off to you bro🙏 you are saviour for web developers 👍
@ImproveProgrammingLogic
3 жыл бұрын
Correct
@VikramKumar-yo6nm
2 жыл бұрын
no doubt👏
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
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.
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
@kalyansreekarjhade2944
2 жыл бұрын
Wtf. I didn't know that the interviewer was Akshay until I saw this comment.😂
@nikhilthakur5089
Жыл бұрын
@@kalyansreekarjhade2944 konsa nasha bhai?
@sumitsahu8657
Жыл бұрын
@@nikhilthakur5089 🤣🤣
@WestcolColombia_
Жыл бұрын
@@kalyansreekarjhade2944 hahahaha me neither, for reak
@aniketfunde7188
Жыл бұрын
Mole 😂😂🔥
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.🙂
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
5 ай бұрын
After 3 yrs
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.
2 min of silence for those who thought they are different persons
@shashikanthp3145
3 жыл бұрын
Do you think people are actually THAT dumb ?
@46divyajeetsingh
3 жыл бұрын
@@shashikanthp3145 Yes, I am that dumb.
@shashikanthp3145
3 жыл бұрын
@@46divyajeetsingh 😂😂 really ? Are you a new subscriber ?
@46divyajeetsingh
3 жыл бұрын
@@shashikanthp3145 yes
@TheCodingOdyssey
3 жыл бұрын
ha ha dying lol!
This namastey javascript series is going to make many folks get a good job
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!
Clash of interviewer and candidates Both came from Namastey JavaScript episodes 😀 They formed closures 💕
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.
@akshaymarch7
3 жыл бұрын
Hahaha 😅
@dmkjava
2 жыл бұрын
hahaha ha ah aha ha ah haa haa
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.👏👏
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.
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 😆
Interview with flawless internet connectivity.
@kumarshubham7017
2 жыл бұрын
And also flawless camera quality :D
@AvikNayak_
3 ай бұрын
@@kumarshubham7017 also flawless audio quality
Holy crap, that's some next level content 😂😂
@ImproveProgrammingLogic
3 жыл бұрын
Right..
He is amazing dude. He had made learning so easy and entertaining, Colleges need this type professors, mentors.
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!
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 !
@akshaymarch7
3 жыл бұрын
Thank you, this comment made my day 😍❤️
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 ❤️
@nagenderrajput5406
2 жыл бұрын
LEGEND*
Never seen this type of educational video before! Mind Blowing! 🙇🙏
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
The interview process was so real, the interviewee grew in confidence with passage of time.HatsOff
@akshaymarch7
3 жыл бұрын
I tried to create an actual interview scenario. Glad you liked it 😇
NamasteJS >>>>> Netflix Loved this one. ❤
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
While watching this video I was thinking how much effort you have put into this series and specially this video. Hats off to you.
cannot believe I'm watching this on a Saturday night instead of Netflix. Keep them coming! Your content is amazing :)
@shourya9898
2 жыл бұрын
Wtf! Same
@sagargadekar6088
2 жыл бұрын
sun night at 0.19am :D
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!!
Cant resist commenting on this........A MasterPiece by a MasterPiece...PURE GOLD 🔥🙌❤
Man I just want to say that you are helping alot of people by making tough concepts easy, thank you from the buttom of my FUNCTIONAL heart😀
Bro you have a hidden actor in you 😂🤣
@kalyantelugutraveller7723
3 жыл бұрын
True
@kin3747
3 жыл бұрын
😅
@ImproveProgrammingLogic
3 жыл бұрын
Right..
@katdareshruti
3 жыл бұрын
Hahaha, these comments helped me understand that the interviewer was himself. I was wondering why the interviewer had such a snobbish attitude😂
@jaideepsah1530
3 жыл бұрын
I liked that interviewer part when he was cleaning the specs 🤓🤣🤣🤣 anyways thanks a lot for explaining in these much of details.
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 !!!!
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!
Manh! I felt anxiety whenever this interviewer asks a question
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!
This video is the peak of absolute epicness. The tremendous amount of efforts he took for providing such a crisp and in depth explanation of practical scenarios is completely on another level. Thank you so much for making JavaScript so much fun to learn.
जग घूमेया थारे जैसा ना कोई 🙌🙌
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
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?
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 ⭐️
The kind of hard work you did Is highly appreciable !
This is gold content, Akshay! it's Saturday and I've binge watching this series since morning and making notes. Love it, concepts are explained in such an amazing way!
The interviewer acting of yours is Scary as hell, a person very calm and also asking penetrating questions.
This was the best possible way to simulate a real world interview and explaining things in form of QnA.
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 💯
This is brilliant. Closure was never explained so nicely before.
what the..... I was getting nervous whenever the interviewer was asking questions, DANG IT !!!!
A guy with good knowledge and a good heart. Hats off men
wish we had teachers like you in schools, colleges and uni aswell....love your way of teachings
Thats really awesome. Quick revision of core concepts. we expect the same overall concepts for React and Angular as well.
This is just amazing !!! This video kind of sums up everything taught in previous videos with all the possible questions and cross questions an interviewer can ask...would suggest you to make similar interview video periodically in namaste javascript, like after every 5-6 videos to kind of summarize everything taught in those previous 5-6 videos..
These kind of discussions and video is just way beyond awesome!!! Thank you so much for this video. My half hour was so productive watching this video ..
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.
Who wants Netflix series when we have Namaste JS. Next level teaching
The mark on the interviewer.. I was cleaning my screen but then realized.. Haha
@akshaymarch7
3 жыл бұрын
Hahaha 😂
@vinothkumarv9722
3 жыл бұрын
It's another version of akshay bro....❤️🙏👍
@simple8810
3 жыл бұрын
hahahahhahahahahahhah trust me i was thinking there are actullay 2 diff friends
@vinothkumarv9722
3 жыл бұрын
@@simple8810 awesome....bro akshay did and doing well intraction...Always
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 😍😍😍😍
Learning this way is so much fun, keep up the good work,love the way explain the roots of every concept 🔥
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 ❤️🔥🔥🔥
@akshaymarch7
3 жыл бұрын
Wow, glad you noticed. I intentionally tried to act like that. 😅 Thank you so much for your comment, love you brother! ❤️
@tabrezdn1
3 жыл бұрын
@@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. 😀
@akshaymarch7
3 жыл бұрын
@@tabrezdn1 The Candidate. 😁
Really the craziest js interview..thanks a ton brother🤯
took me 7 mins to notice that both are same people nice video got a lot of doubts cleared
You are multi talented man! You have deep knowledge, you know how to explain things precisely, you made learning these concepts entertaining. You have put lot of efforts into it. These efforts of yours are very helpful to students like us. Thanks a ton!
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! 😆
@milanvala7940
2 жыл бұрын
hahahaha
Akshay next level content representation. Content is too good.
even after so smart and deep answers not a single smile on interviewer's face
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.
You are one of the Best Gem I found on LinkedIn. Thank you very much for the lesson I am getting which I thought that are tough and not very much used in the Practical in-hand experiment. But gradually don't even know how those concepts I learned and used in the day-to-day task. Thank you, Sir. One day I will crack product-based and good projects and the lessons you teach us so far!!🎉✔
Best teacher award goes to Saini Sahab 🎉🎉❤️
Fun learning!! Keep it up man! Awesomely done!
Man this guy can act! Solid video boss! Huge respect for putting the effort and making this come alive
Please make a "behind the scenes" or "the making of" of this video. This is insightful as well as entertaining.
Great men extremely helpful 🔥🔥😍❤️
This is soo amazing, you have put in lot of efforts. Clears the concept of closure very well. I didnot knew what ()() does at all.
This is really Great Akshay! This video has both personalities, the confidence and wittiness of interviewers and nervousness of a candidate. Truly Great Work!
Nobody can beat you in closure...Amazing video big fan.....🙏
This happens when Creativity meets Knowledge, dope nice video .... loved it...
The interviewee did a fantastic job. I can see the uncertainty, fear and anxiety on his face. Perfectly recreated the interview scenario. Kudos
Your videos helped me to answer questions with confidence in my first interview which I attempted after 4 years. Thank you!
Throughout the whole video I was wondering how you synced both the interviewer and interviewee. Hats off to you sir. NJs ❤🔥
A zillion congrats. I don’t know why people waste time on carryminati.
@kalyanipriyadarsini
2 жыл бұрын
Because all aren't programmers
@partyhouse1024
2 жыл бұрын
Bhai mt bol warna yaha bhi dislike ki history bana denge log
@abhijiths148
2 жыл бұрын
Lol so true 🔥😂😂😂
@asifahmadahmad61
2 жыл бұрын
Because carry has roasting and entertaining domain. Don't tell me, you code 24*7. you do enjoy other things too.
@ratul_hasan_rahat
2 жыл бұрын
Open up your mind. Your so closed.
just looking like a wow Akshay Bhaiya you are gem. I didn't find this type of explanation on youtube yet. You are very helpful to grow my JS skills
Every next qn the interviewer asked was the doubt on my mind! Beautifully executed!
Beautiful interview, I am sure if asked in interview, I will definitely say namaste javascript❤❤❤❤❤
The best thing About this interview was that it felt real
Congratulation Akshay and BIG THANK YOU for this great course you have done... Really thats the best course i have ever watched even if i am not finished it yet.. keep teaching us with you good energy. We appreciate it !!!
You're amazing, man. You're helping a lot of people to get better jobs and improve their quality of life
Ohhh man🔥🔥🔥your videos will bring evolution in the world of javascript😌✨I'm happy to find your playlist earlier in my clg days🙏 waiting for more vdos..😅(expectations from you are on high now)💯
@akshaymarch7
3 жыл бұрын
Thank you for your `Highestest Expectations`, I'll try my best to keep up to them. ❤️
Akshay, appreciate the amount of effort that must have gone into making this mock interview. Thanks a ton!! 💙
Watched the full video and enjoyed learning - Thanks for this !
Truly, just splendid in one word.
I was really impressed with the last question : Where did you learn all this stuff with your answer 😅🤣😂
31:44 Akshay being impressing by Akshay 😂😂 This was some dope content!! 👏👏 Thank you!!
Loved ur entire Namaste JS series but this was somewhere next level 🙏❤️
Right teacher will make us learn and love the most hated subject also. You are the Right One!!!