Lexical scoping and Closure | chai aur

Поділитися
Вставка
  • Опубліковано 19 лис 2024

КОМЕНТАРІ • 431

  • @momlifevlogging
    @momlifevlogging 2 місяці тому +14

    I have never never understood the basics of these things like closures, lexical scoping and data structure etc. but this guy deserves hats off.... literally you need a gold medal for teaching in such an awesome way. i am first time commenting on any youtube coding video.

  • @vikasmaur1206
    @vikasmaur1206 Рік тому +141

    0:00 Introduction
    1:55 Reading the MDN docs
    3:23 Lexical Scoping
    14:00 Closure
    18:09 Practical Implementation

  • @prakharsinha4145
    @prakharsinha4145 Рік тому +70

    trust me sir! you will be known forever for this Javascript series! The Best on the planet!

    • @chaiaurcode
      @chaiaurcode  Рік тому +52

      Abhi to bs shuru hue h 😁

    • @aqdusali8507
      @aqdusali8507 9 місяців тому +1

      sir, when second part comes?@@chaiaurcode

  • @muhammadadil-or3kb
    @muhammadadil-or3kb 8 місяців тому +3

    0:00 Introduction
    1:55 Reading the MDN docs
    3:23 Lexical Scoping
    14:00 Closure

  • @shubhamkumarjha9192
    @shubhamkumarjha9192 Рік тому +16

    0:00 Introduction
    1:55 Reading the MDN docs
    3:23 Lexical Scoping
    14:00 Closure
    18:09 Practical Implementation
    very very helpful playlist Thank you so much sir for this Premium course on javascript for free..

  • @abhishekkumargupta543
    @abhishekkumargupta543 Рік тому +8

    I have not shared your videos links to anyone but I have recommended many friends to watch your videos . if they don't know any topic and try to ask me then I use to say "AAGAR AAP NE CHAI AUR CODE PE HITESH SIR SE PDE HOTE TO MERE SE NHI PUCHTE ", No doubt you are super. keep making videos and get motivated . I started watching your videos 3 years back but i was never serious but now I am int the stream. Once again thank you sir.

    • @ExploreSciFi
      @ExploreSciFi 6 місяців тому

      apana poura dimage lagaya ha
      mein bhe yahhe karuga insh'ALLAH

  • @NaumanMalik-e2e
    @NaumanMalik-e2e 6 місяців тому +9

    I tried many videos and channels for closures but finally I found this guy. Thank you so much sir

    • @chaiaurcode
      @chaiaurcode  6 місяців тому +8

      Happy to help🤗☕️

  • @anilray9419
    @anilray9419 10 місяців тому +2

    Aaapko hirday se naman hai prabhu......aapse to interview dene wale hi nahi balki interview lene wale ko bhi sikhna chahiye....aapka video to mai dekhta and like share karta rahta hu but ispe to aapne comment likhne ko majbur hi kar dia

  • @AnnoyedBeachChairs-pk8jm
    @AnnoyedBeachChairs-pk8jm 5 днів тому

    very very helpful playlist Thank you so much sir for this Premium course on javascript for free..

  • @SarveshKumar-08
    @SarveshKumar-08 11 місяців тому +2

    00:03 The video will cover two interesting topics: closure and lexical scoping.
    01:47 Understanding closure and its access to outer function scope with MDN docs.
    05:36 Lexical scoping does not allow access to variables declared inside a function in the outer scope.
    07:55 Inner functions have their own execution context and share memory with the outer function.
    11:51 Understanding Outer and Inner Function.
    13:37 Explanation of lexical scoping and its significance. Detail explanation of closure through an example
    17:32 Lexical scoping and closure return the entire lexical scope of a function when a complete function is returned.
    19:14 Using onClick event and changing background color in JavaScript
    22:27 Understanding the difference between a function and a reference to a function.
    24:03 In Summary Functions have access to variables defined in their outer scope.
    Closure allows a function to retain access to variables from its lexical scope

  • @Codewith_ammu
    @Codewith_ammu Місяць тому

    Ab Jake Maine aapko subscribe Kiya hai sir . Meri Jo aadat hai pehle dekhta hun uske baad believe karta hun 😅😅. Aapki playlist kafhi achi hai aur mujhe mja aaya aur maine aapne berojgar dosto ko bhej diya hai aur unko motivate bhi kar diya hai aur aapki playlist jarur dekhenge. Thank you so much Sir 🫡🫡

  • @sanantakumarrath1775
    @sanantakumarrath1775 Рік тому +1

    I don't see any video , but just came to learn about closure , and Hitesh sir's teaching is ABSOLUTEBEAUTY, and he teach me how to read documentation that most important thing for me

  • @Tech_Life_2.0
    @Tech_Life_2.0 Рік тому +3

    13:40 laxical scope completed awesome 🎉🎉

  • @TheSuyash08
    @TheSuyash08 6 місяців тому

    Hitesh ji In this lecture you have explained this two topics very easily. The topics which sounds very difficult, you made it look very simple with awesome example. Thanks a lot

  • @VishalYadav-kp5cp
    @VishalYadav-kp5cp Рік тому +1

    Thank you so much sir
    Javascript ki Sabse best series provide krne ke liye
    Maine puri series follow Kiya jisse mujhe javascript samjh aane laga aur ab kudh se project bhi bana leta hoon....
    Again Thank you so much sir 🙏

  • @sudiptobose8296
    @sudiptobose8296 3 місяці тому

    13:07 you are the best. baki youtubers k video ko dekh kar samjh nahi aya but yeh video dekh kar mere atma ko santushti mil gaya.

  • @muhammadarslan78676
    @muhammadarslan78676 Рік тому +1

    This is the best explanation for closures ever, Thanks man

  • @VikashSingh-hc6zo
    @VikashSingh-hc6zo 11 місяців тому

    Simple Crisp Clear now i know about closure and lexical scoping.Thanks a lot Hitesh SIr

  • @Dev-Phantom
    @Dev-Phantom 10 місяців тому +2

    application of this Lexical scope was totally new for me. very intersting

  • @Razzaq69
    @Razzaq69 7 місяців тому

    yes i watched few other videos before this, lekin my concept got cleared when i watched this video. Thanks Hitesh Sir 🙂

  • @AbhishekKumar-cd4gg
    @AbhishekKumar-cd4gg 25 днів тому

    yeah definetly sir it is one of the good examples of closures but still we can do the same task with the help of arrow function also
    here the code
    const orange = document.getElementById("orange");
    const green = document.getElementById("green");
    orange.onclick = () => clickHandler("orange")
    green.onclick = () => clickHandler("green")
    function clickHandler (color) {
    document.body.style.backgroundColor=`${color}`
    }

  • @abhishekkumar-v5s2s
    @abhishekkumar-v5s2s 3 місяці тому

    best teacher ever seen in my coding phase escpecially in mern stack

  • @relaxingmusic8781
    @relaxingmusic8781 11 місяців тому

    Here I got Cristal cleared the concept of closure
    Thank you so much sir 🙏🙏
    Your way of teaching is awesome

  • @sujalbhandari2334
    @sujalbhandari2334 3 місяці тому

    finally i understood the lexical scope thank you sir for being here to teach us. love from nepal

  • @Vcoder23
    @Vcoder23 4 місяці тому

    Mini project based lexical scoping and closure example was cheery on the cake!!!!!

  • @pratikbidve8316
    @pratikbidve8316 Рік тому +2

    Badhiya aaisa sikhayege to koi bhi sikh jayega coding.

  • @ShaheenNkhan
    @ShaheenNkhan 8 місяців тому

    Woww amazing. What a crystal clear explanation.
    Thank-you so much sir.

  • @razashah7881
    @razashah7881 9 місяців тому

    Sir very nice. aapney bilkul desi method me samjhaya to samajh aa gai otherwise mujhe 7 din ho gaey hen me isee topic par hi phsa hua tha. aksar videos or blogs me bohat mushkil examples di jati hen jo samajh me nai aaten.

  • @AbheyKhurana-tc6be
    @AbheyKhurana-tc6be 6 місяців тому

    Best explanation of Closures with example💯

  • @Instrumentation010
    @Instrumentation010 10 місяців тому

    What a practical explanation, I don't have words to appreciate your work.

  • @MeenakshiBisht-wz9rs
    @MeenakshiBisht-wz9rs 4 місяці тому +1

    Thank you sir for this amazing series 😊

  • @BhavnaChoudhary-gg1ge
    @BhavnaChoudhary-gg1ge 4 місяці тому

    I have watched many channel for javascript but the way you explain all the concepts...i have really became fan of ur teaching style... Hat's off to you 🙌🙏 @chaiaurcode

  • @ibcer.shubhamsinghbadabusi7586
    @ibcer.shubhamsinghbadabusi7586 2 місяці тому

    1.5x me bhi ek hi baar me samajh aa gaya. waah kya chai hai haha. Thank you so much sir..

  • @Sanjuuu242
    @Sanjuuu242 2 місяці тому

    Thanks alot for this course sir, best js course in youtube and mainly you never get bored

  • @jast_aryan-13
    @jast_aryan-13 10 місяців тому

    Sir aap hr concepts ko practical examples se explain krte usse bhut ache se samj ata thanku sir for thi series😊❤️

  • @srikarravoori124
    @srikarravoori124 3 місяці тому

    The best tutorial on the internet ever!

  • @erratumfoe4882
    @erratumfoe4882 2 місяці тому

    FINALLY completed the series. This series of yours gave me confident to more dive into JS environment. I believe if I came across this masterpiece a year ago, It would've been a great investment. Thank you sir💗

  • @nadeemakramansari1331
    @nadeemakramansari1331 10 місяців тому

    You are giving a great content for free. Hats off to you brother. Now I know what is lexical scoping and closures.

  • @muhammadyaseenakhtar7789
    @muhammadyaseenakhtar7789 6 місяців тому

    Concise and crystal clear.. Awesome, Thanks ❤❤❤

  • @muhammadkamran3948
    @muhammadkamran3948 9 місяців тому

    Amazing sir . i have watching many videos about lexical scoping and closure but I can't understand but sir after watching yours videos now I realize that its very easy

  • @roshanrawat0110
    @roshanrawat0110 7 місяців тому

    Finally 2nd time completed whole series
    Thank You so much @Hitesh sir for such an amazing playlist 😍😍🤩🤩😇😇

  • @mayeshafairuz
    @mayeshafairuz 9 місяців тому

    Kya shamjhaya sir, kya hi intelligence hy bhai, mza agya! Thank you soo much!

  • @m_sahoo12
    @m_sahoo12 2 місяці тому +1

    Now I have confidence to learn React 😀😀

  • @RohitChhabirajYadav
    @RohitChhabirajYadav Рік тому +2

    finally koi yt ki playlist Finish kiya first time in my life

  • @nrp853
    @nrp853 20 днів тому

    very intresting teaching style...wow sir☺👌👌👌

  • @developer_dhanji
    @developer_dhanji 4 місяці тому

    Revise after 4 month and this time understanding is mindblowing

  • @Sneakingmentor
    @Sneakingmentor Рік тому +1

    Ek baar mein samak aagaya. Thnx Hitesh sir.

  • @Vyadav.
    @Vyadav. Рік тому

    one of the best lexical scope and closure video ... maza aaya

  • @Vishal_0841
    @Vishal_0841 9 місяців тому

    Here is something different from other creator who doesn't give proper example of closures they only say closure is created when a function is defined inside another function and allowing inner function to access variable from outer function's scope. AS Well as they give simple example of lexical scope for understanding which is really tough for understanding this topic. But you nailed it guruji 👏

  • @BitFire007
    @BitFire007 8 місяців тому

    "Chai aur Code, you've created a masterpiece with your JavaScript tutorials. Thank you for your brilliance!"

  • @refrigerationairconditioni4655

    yes deal done and thankyou for in depth js series lane k liye maza aa gya 90 % plus improvement in my js skill thankyou so much again and again

  • @ShivamSrivastava223
    @ShivamSrivastava223 Рік тому

    The best explanation of closures and lexical scope, thank you sir

  • @pranav5273
    @pranav5273 Рік тому

    Hindi mai sikkh na is a superior way of learning, thank you Sir ji!

  • @premlenovo3098
    @premlenovo3098 11 місяців тому

    koi bhi problem ho solution is always our ❤ hitesh sir
    sir apke samjaneme ek calmness hai

  • @priyanshukumar6679
    @priyanshukumar6679 5 місяців тому

    I am revising and literally no one explained like you ❤

  • @umarnoor7417
    @umarnoor7417 Рік тому

    Awesome explanation for that last part "lexical scoping" in coloring background!

  • @omaewamoushindeiru3303
    @omaewamoushindeiru3303 5 місяців тому +1

    25:40 so here's the explanation and my understanding of this particular example ---
    The onclick here requires a reference of a function so that it can call it when the click event occurs on corresponding button, we always pass reference in this type of situation to prevent the function to get executed immediately.
    But the problem is we can't just pass the reference of the function because as we know it requires the color in the form of parameter and we are noy storing the reference in variable like structure such as let refHolder = clickHandler; so we can't call the refHolder later with the color parameter later in code such as refHolder('blue').
    In reality, we are giving the reference to onclick which doesn't have an in built functionality or human intelligence to call this clickHandler with argument based on the button.
    So now we actually have a tiny war between onclick() demanding a reference and clickHandler(color) which demands to be called with a parameter only otherwise error.
    Now in order to fullfill the demand of bith entities, we can we will indeed call the clickHandler() with color parameter passed ( demand fulfilled ) but at the same time we will do something that a reference is given to onClick function ( which it strictly demands ), we will return reference of an inner function which does the main work or logic( demand fulfilled ) ( Very important thing to note here is this could not have been achieved without the feature of lexical scoping )

  • @nageshkarle1218
    @nageshkarle1218 8 місяців тому

    Super Sir, 4 mobiles in my home so i have subscribed 4 times also i have subscribed office mail id too❤ thank you soooo much sir , i have not shared your videos links to any one but i told to lots of pepole that if you want to learn javascript then you watch the video of chai or code channel

  • @balvantbiharichaprajila3673
    @balvantbiharichaprajila3673 10 місяців тому

    The best part of video is
    ki ye parents child bhai bhai ke example se jo ye aapne sikhaya hai
    mereko nahi lagta ki ham isko bhulenge

  • @AnshuKushwaha-xz8di
    @AnshuKushwaha-xz8di 2 місяці тому

    aaj dhire dhire krte krte pura series dekh aur sikh liya

  • @computerduniya-cs9tg
    @computerduniya-cs9tg Рік тому

    ye only course hi nhi ye to js ka Ramban course h jisne chai or code se padh liya wo to bhul nhi sakta Thanks for hitesh sir chai or code will growth soon

  • @utkarshdixit4611
    @utkarshdixit4611 4 місяці тому

    Thankyou sir for making this playlist ❤❤

  • @siddheshshiposkar6815
    @siddheshshiposkar6815 10 місяців тому

    very well explained.
    Thanks for such kind of explanation

  • @048_shashishankar8
    @048_shashishankar8 8 місяців тому

    this is a hepl full series and first impresive series in UA-cam for free thanks sir

  • @akroyalmaker
    @akroyalmaker 5 місяців тому +1

    finally javaScript Chai is ENDDDDD...☕☕❤❤

  • @meraqsam-kashi
    @meraqsam-kashi Рік тому

    i see bundle of lectures on this concept but u r the best kia bat hy app ki to

  • @SameerDeadline
    @SameerDeadline Рік тому +4

    Lexical scoping 00:01 to 13:45

  • @hrithikgupta1809
    @hrithikgupta1809 Рік тому

    Want more Videos on JavaScript like this !!!!😍

  • @himalalynrhs4405
    @himalalynrhs4405 3 місяці тому

    you are god of javascrript sir!

  • @jagatkrishna1543
    @jagatkrishna1543 Рік тому +1

    Thanks 🙏 SIR ❤
    Hannnji
    Hindi main aap ka voice bahat hi achha lagta hai.

  • @RagSingh-e2e
    @RagSingh-e2e 8 місяців тому

    best Series ALL OVER THE UNIVERSE, thank you Sir 🙏

  • @rajanbhai5043
    @rajanbhai5043 4 місяці тому

    1:55 Reading the MDN docs
    3:23 Lexical Scoping
    13:33 Closure
    18:09 Practical Implementation

  • @MuhammadMasood-p9r
    @MuhammadMasood-p9r 20 днів тому +1

    Lexical scoping completed at time stamp 13:30

  • @BiswajitJena-n1t
    @BiswajitJena-n1t Рік тому

    Best Closure and lexical scope Explanation sir😇

  • @Dev-Phantom
    @Dev-Phantom 8 місяців тому +1

    best example for interview

  • @nharish5965
    @nharish5965 8 місяців тому

    sir i liked your speed of teaching, love u sir

  • @ashishpatil50
    @ashishpatil50 9 місяців тому

    when i see first lecture i feel lecture is going very slow , but after some days this is a way to learn something

  • @tech_channel110
    @tech_channel110 Рік тому

    kamal kr diya ap nay
    behtareen in depth lecture

  • @arifnaikwadi1838
    @arifnaikwadi1838 4 місяці тому

    Chai piyo coding karo.....sir bahot badiya samajh me aa gaya.

  • @PoojaRawat-gy3qm
    @PoojaRawat-gy3qm 6 місяців тому

    thank you so much sir for this JS series.

  • @assignmentonbiologytopic9512

    Hatish bhaiya very very thanks for this Js series.
    💕 From 🇵🇰

  • @aladdin_885
    @aladdin_885 8 місяців тому

    thanks sir for this series. today, I completed this series 😊😊

  • @SuryaKarigar
    @SuryaKarigar 11 місяців тому +1

    Lexical scope is everywhere. All functions can access global variables. However variable or properties declared inside a scope is generally not accessible by the parent or global scope. I think the window itself is a function. I found it pretty early, but still, I hesitate to state this. Hitesh Sir if you're reading this comment then please correct me if I'm making any mistake.

  • @Priyanka-bd6um
    @Priyanka-bd6um Рік тому

    My so many myths broken today related to closures, Thank you sir

  • @shadikhusain1216
    @shadikhusain1216 Рік тому

    Sir abb to jitni bhi videos aa rahi hai sabb deshi ghee mil raha hai. 😂 saara maal abb last mai mil raha hai JS ka.prr abb chai aur code pe subscriber bhi toofaan ke saath chal rahe hain aage dhamaal machega esi playlist pe.Thank you @Hitesh Sir regularity ke liye.❤

  • @ManishKumar-i3k6m
    @ManishKumar-i3k6m 33 хвилини тому

    Sir mujhe laga closures tuff topic hai ye to bada aasan nikala

  • @biswajitnayak5216
    @biswajitnayak5216 4 місяці тому

    0:00 introduction
    1:55 Reading Mdn docs
    3:23 Lexical scoping
    14:00 closures

  • @ImSRJY
    @ImSRJY Рік тому +71

    यूट्यूब पर कोचिंग का खेल तो चलता रहेगा, कोर्स आएंगे, जाएंगे.. कभी फ्री बनेंगे कभी पेड लेकिन ये चाय और कोड रहना चाहिए इसका बेशकीमती जावास्क्रिप्ट का कोर्स अमर रहना चाहिए। ❤❤

  • @Cmunx
    @Cmunx 11 місяців тому

    Thank you sir ❤.. maza aya apke sath smoothly js padh paya 🤌

  • @poojaer2907
    @poojaer2907 9 місяців тому

    Thankyou so much sir for this after watch this video my closer concept perfectly clear thanks.🙏👍

  • @shyam_soni99
    @shyam_soni99 9 місяців тому

    "Hats off to Hitesh sir for his exceptional mentorship in the JavaScript series - truly inspiring! 🎩"

  • @biswajitghosh5149
    @biswajitghosh5149 11 місяців тому

    Sir Thank you. I have learn lot of from you. You are GOD to me. ❤❤❤❤

  • @sabirpathan430
    @sabirpathan430 Рік тому

    Always good video same as good quality and high energy

  • @MuhammadUmerHussain-t5b
    @MuhammadUmerHussain-t5b Місяць тому

    Explained very well

  • @endgame3842
    @endgame3842 Рік тому +2

    Arey sir ek hi to dil hai kitnee barr jeetogai...

    • @chaiaurcode
      @chaiaurcode  Рік тому +4

      Aap linkedin pe share hi itni baar kr rhe ki aur videos bnane ka mn krta h

    • @endgame3842
      @endgame3842 Рік тому +1

      @@chaiaurcode sir Tagg kra hai aapkoo...
      Finally completed 50/50 videos with complete understanding and with notes as well proper practice

  • @Leo-qo5hk
    @Leo-qo5hk Рік тому

    Thanks Hitesh bro for this amazing JS series 🙏

  • @albabibnmakbul4263
    @albabibnmakbul4263 10 днів тому

    finally understand closer.

  • @ArunChauhan-f4y
    @ArunChauhan-f4y 4 місяці тому

    0:00 introduction
    1:55 Reading the MDN docs
    3:23 Lexical Scoping
    14:00 Closure..

  • @ariansojib9195
    @ariansojib9195 Рік тому

    Great content sir!! Love and respect from Bangladesh ❤

  • @dakshpawan4719
    @dakshpawan4719 Місяць тому

    kaafi achha samjhate ho sir