Note: You might not see [[Scopes]] in the console because in new version of Chrome they have removed it. If you want to see it then please us any older version of Chrome which was available before uploading this video that is September 2022. Chrome in August 2022: google-chrome.en.uptodown.com/windows/download/79849930
Explanation at its peak, Thanks a lot. There can be many use cases for closures, one of the simple use case that I came across is we can sort of mimic the Class methods and instance creation with this, like below. function account() { let bal = 0; function initilize(amount) { bal = amount } function credit(amount) { bal+=amount } function debit(amount) { bal-=amount } function showBalance() { console.log("Your current balance is", bal) } return {initilize, credit, debit, showBalance} } const a0 = account() a0.showBalance(); // output - Your current balance is 0 a0.initilize(50) a0.showBalance() // output - Your current balance is 50 a0.credit(11); a0.showBalance(); // output - Your current balance is 61 a0.debit(9) a0.showBalance() // output - Your current balance is 52 similarly we can create other accounts i.e. a1, a2 and each will have different memory.
Sita Ram must have planned something great for me in this career that's why I discovered your channel sir. whatever is the topic I need to learn you have the detailed video of that. Hats off to you sir.
Great Video Anurag! Till now I was only knowing the definition, now clearly understood what closure means and also about their disadvantages and advantages. Also please make videos on function currying and memoization. Thanks :)
Sir, Love You for your teaching way and your hard work ⭐, kaafi accha lag raha hai JS aapse padkr or bhut kuch sikne ko bhi mila, mai continuously aapke CSS or JS ki playlist ko follow kiya or abhi JS kar raha hu or maine kaafi kuch sika, OR Really maine Debugging pheli baar itni acche se sikhi hai JS mai 🚀💯, ThankYou So Much Sir
Ye to bahot achhi baat hai ki tumhara padhai mein lag raha hai. Aise ki padhai karte raho aur seekhte raho, koi bhi doubt aaye to yaha comments mein bhi poochh sakte ho aur telegram group mein bhi. Keep learning and sharing 😊
Awesome, achhe se samjhne mein time to lagta hai. Agar aur bhi janna hai closures ke bare mein to ye wali video bhi dekh sakte ho. ua-cam.com/video/w_-fVsa6qns/v-deo.html
So grateful for explored this channel very well explained everything... just wanted to ask have you uploaded fundamental of Javascript or only advance JS playlist?
Not now bro. Web development and JavaScript are my expertise. So if you ask me anything related to that I will definitely make it. Talking about Python, I don't have much experience with that. So, I won't be making course on it any soon.
There is no thought of compression... execution context...is all about. How the program will be executed as per javascript engine, and closure define the scope of execution or extent of availablity of variable (state) for a function
Sir my lower middle class family se belong karata hu my 4-5 year se dhekedari me pardesh rahakar Kam kar Raha hu my one month se aap ka video starting se dekh Raha hu Mere pass sir laptop nhi hai my second hand laptop kharidane ja Raha hu coding sikhane ke liye Sir coding sikhane ke liye kaun sa laptop kharidu my . Sir please bataiye my life me kuch karana chahata hu my apane family ka status chenge karana chatata hu kuch acha Kam kar ke Please sir help kariye
Great Video Anurag! Till now I was only knowing the definition, now clearly understood what closure means and also about their disadvantages and advantages. Also please make videos on function currying and memoization. Thanks :)
Note: You might not see [[Scopes]] in the console because in new version of Chrome they have removed it. If you want to see it then please us any older version of Chrome which was available before uploading this video that is September 2022.
Chrome in August 2022: google-chrome.en.uptodown.com/windows/download/79849930
Explanation at its peak, Thanks a lot.
There can be many use cases for closures, one of the simple use case that I came across is we can sort of mimic the Class methods and instance creation with this, like below.
function account() {
let bal = 0;
function initilize(amount) {
bal = amount
}
function credit(amount) {
bal+=amount
}
function debit(amount) {
bal-=amount
}
function showBalance() {
console.log("Your current balance is", bal)
}
return {initilize, credit, debit, showBalance}
}
const a0 = account()
a0.showBalance();
// output - Your current balance is 0
a0.initilize(50)
a0.showBalance()
// output - Your current balance is 50
a0.credit(11);
a0.showBalance();
// output - Your current balance is 61
a0.debit(9)
a0.showBalance()
// output - Your current balance is 52
similarly we can create other accounts i.e. a1, a2 and each will have different memory.
JS course ke ep38 pe thi, udhar samajh nhi aaya issiliye ye video dekha. Finally closure samajh aagaya. thank you sir.
same here
Sita Ram must have planned something great for me in this career that's why I discovered your channel sir. whatever is the topic I need to learn you have the detailed video of that. Hats off to you sir.
You'll definitely do well in your career. All the best 👍
This is the best comment i've seen to a coding creator
Finally, I understand the concept of closure. Thank you so much, sir
Great Video Anurag! Till now I was only knowing the definition, now clearly understood what closure means and also about their disadvantages and advantages.
Also please make videos on function currying and memoization.
Thanks :)
Sir, Love You for your teaching way and your hard work ⭐, kaafi accha lag raha hai JS aapse padkr or bhut kuch sikne ko bhi mila, mai continuously aapke CSS or JS ki playlist ko follow kiya or abhi JS kar raha hu or maine kaafi kuch sika, OR Really maine Debugging pheli baar itni acche se sikhi hai JS mai 🚀💯,
ThankYou So Much Sir
Ye to bahot achhi baat hai ki tumhara padhai mein lag raha hai.
Aise ki padhai karte raho aur seekhte raho, koi bhi doubt aaye to yaha comments mein bhi poochh sakte ho aur telegram group mein bhi.
Keep learning and sharing 😊
1 din poora laga closures ko acche se samajhne me baaaki samajh aa gaya aur kabhi na bhulu esa samajh aaya, par time laga and thank you bhaiya...😊😊
Awesome, achhe se samjhne mein time to lagta hai. Agar aur bhi janna hai closures ke bare mein to ye wali video bhi dekh sakte ho.
ua-cam.com/video/w_-fVsa6qns/v-deo.html
Sir aap bahot mehnat karte hai, ham sabke liye, is video ko dekhne ke bad realize hua
your way of explanation is so amazing👌👌👌👌
nicely explained
Thanks bro
So grateful for explored this channel very well explained everything... just wanted to ask have you uploaded fundamental of Javascript or only advance JS playlist?
Thank you so much Bro 😊.
Fundamentals of JavaScript I will start from 1st of November.
@@procodrr That's super cool bro waiting for it. Best luck 🤩😇
Awesome bro 😊
@@procodrr ☺😇
@@procodrr Just one more question to ask in future are you coving full stack(MERN) Bootcamp?
Lots of love bro❤
32:00 Both are same closers and lexical scope
Yes, they are kind of same in one way. But when lexical scope gets attached to a function then we call it a Closure.
@@procodrr yes sir parent function k variable ko access krenge child function then create a closures and lexical
thank you for your brilliant content sir. highly appreciate it!!
Wowww That's gazab 😍
Sir you're best thank uhh ❤🥀
Make a tutorial on how to use dev tools and debugger
Sure, I will make a video on it.
Hi Bro, I have just uploaded that debugging video.
You can check it out.
@@procodrr sure bro
You're really amazing
Thank you so much 😀
Awesome!!!!❤ it
bhaiya leet code 30 day challenges ki video bana do sir m
kadak bhai
Please make a tutorial on ruby
😀😀
Bas khatam! Interviewer ka Closure set hai! Aage zindagi mein kab use karna hai isko, ye Closure hi jaane.....
Thank you so muchhh!!!
Great sir
Please make a tutorial on python
Let him finish JS first?
Yes, Right now I am focusing only on JavaScript.
Not now bro. Web development and JavaScript are my expertise. So if you ask me anything related to that I will definitely make it.
Talking about Python, I don't have much experience with that. So, I won't be making course on it any soon.
Is execution contest and closure are same ???
There is no thought of compression... execution context...is all about. How the program
will be executed as per javascript engine, and closure define the scope of execution or extent of availablity of variable (state) for a function
Sir my lower middle class family se belong karata hu my 4-5 year se dhekedari me pardesh rahakar Kam kar Raha hu my one month se aap ka video starting se dekh Raha hu
Mere pass sir laptop nhi hai my second hand laptop kharidane ja Raha hu coding sikhane ke liye
Sir coding sikhane ke liye kaun sa laptop kharidu my .
Sir please bataiye my life me kuch karana chahata hu my apane family ka status chenge karana chatata hu kuch acha Kam kar ke
Please sir help kariye
sir promises ka bhi end game lekr aao
51:55
Great Video Anurag! Till now I was only knowing the definition, now clearly understood what closure means and also about their disadvantages and advantages.
Also please make videos on function currying and memoization.
Thanks :)
Thanks bro. I'll make that video for sure.