What is Hoisting? | Most Asked JS Interview Question | The Complete JavaScript Course | Ep.32

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ธ.ค. 2022
  • Starter Code: github.com/procodrr/javascrip...
    Final Code: github.com/procodrr/javascrip...
    Hoisting is one of the most underrated yet most asked interview question in javascript. In this video, we'll learn what excatly hoisting is javascript means!
    We'll dive deep into the concepts to get a clear idea of temporal dead zone, yes, something we need to cosider. Well, there's one thing I can bet, you'll be so clear that hoisting would be nothing but a cake walk for you.
    JavaScript Repo: github.com/procodrr/javascrip...
    Bootcamp Repo: github.com/procodrr/frontend-...
    Have any doubts? Join this Telegram group and ask your question. You can also share the projects that you make in this group.
    Telegram Group : t.me/procodrr
    Social Media
    🌐 Telegram: t.me/procodrr
    🌐 Linkedin: / anurag-singh-web-devel...
    🌐 Instagram: / procodrr
    🌐 Twitter: / anuragsinghbam
    🌐 Portfolio: anuragsinghbam.com/
    Music by geoffharvey from Pixabay

ความคิดเห็น • 51

  • @abhishekkumar-ub2ln
    @abhishekkumar-ub2ln 22 วันที่ผ่านมา +4

    I felt it, when you said, @24:05 anonymous ki spelling bahut khatarnak hoti h(CBSE wale is pain ko kabhi nhi samajh sakte.)

    • @procodrr
      @procodrr  2 วันที่ผ่านมา

      😀😀

  • @nobody20022
    @nobody20022 หลายเดือนก่อน +2

    Summary:
    What is hosting?
    JavaScript Hoisting refers to the process whereby the interpreter appears to move the declaration of functions, variables, classes, or imports to the top of their scope, prior to execution of the code.
    const and let can not access the value before initialization because they are placed in a temporal dead zone. But in var case, it will give undefined.
    But in function, we get values of function because function values are stored during the memory creation phase so we just get access to it.
    this much I understood from this video.
    *Correct me if I am wrong.

  • @SahilRajput-io6ns
    @SahilRajput-io6ns 2 หลายเดือนก่อน +4

    Best way of explaning thanks
    saw so many videos on this topic all are saying hoisting is to move the declarations to the top but you explained in detail how javascript hoisting is working in background thanks for making this video😊

    • @procodrr
      @procodrr  2 หลายเดือนก่อน

      Awesome, keep learning and sharing 😊

  • @souvik5560
    @souvik5560 5 หลายเดือนก่อน +2

    Clear explanation with proof 👍🏻

  • @zuhairrehman2526
    @zuhairrehman2526 หลายเดือนก่อน +1

    Very nicely explained! My memory creation phase is running at full speed now!

  • @ParvezKhan-ep7zg
    @ParvezKhan-ep7zg 3 หลายเดือนก่อน

    🎉🎉🎉 bhot Hi Simple Way me Explain kardiya ❤❤❤ 10 out of 100 💯💯💯💯😁

  • @AdarshSingh-hm8ss
    @AdarshSingh-hm8ss 2 หลายเดือนก่อน +1

    00:02 Hoisting in JavaScript is a commonly asked topic in interviews
    02:46 Hoisting in JavaScript moves variable and function declarations to the top of their containing scope.
    04:39 Hoisting in JavaScript allows accessing variables before their declaration without errors.
    07:15 JavaScript hoists variable and function declarations
    09:39 Hoisting in JavaScript allows function and class declarations to be accessed before they are defined.
    11:56 Function declaration hoisting in JavaScript
    14:19 Hoisting in JavaScript allows function declarations to be moved to the top of the code.
    16:48 Hoisting in JavaScript explained
    19:27 Understanding function declaration, definition, and hoisting in JavaScript
    21:51 Hoisting is a process of moving variable and function declarations to the top in JavaScript
    23:49 Understanding function declaration vs. function definition
    Crafted by Merlin AI.

  • @editworld3581
    @editworld3581 2 หลายเดือนก่อน

    Well explained ! Thank you bhaiya !

  • @syednoman8131
    @syednoman8131 3 หลายเดือนก่อน +1

    Simple and good easy to understand

  • @GauthamHC99
    @GauthamHC99 ปีที่แล้ว +2

    Always is used to confuse between undefined and not defined. Got it clear.
    * undefined is not an error, it is a datatype - thinks to remember for beginners

    • @procodrr
      @procodrr  ปีที่แล้ว +1

      Awesome, I'm glad you learn something new.
      Keep Learning and Sharing 😊

  • @pranabdas3691
    @pranabdas3691 3 หลายเดือนก่อน +2

    Anurag bhai on fire.....❤‍🔥❤‍🔥❤‍🔥❤‍🔥❤‍🔥❤‍🔥

  • @adityasinghh04
    @adityasinghh04 3 หลายเดือนก่อน

    revision done bhaiya.

  • @Sumeet_Katkade
    @Sumeet_Katkade 4 หลายเดือนก่อน +1

    i like it....... i like this video also now total like is =70....this guy deserve more like and subscriber...

  • @adityasinghh04
    @adityasinghh04 3 หลายเดือนก่อน

    Episode 32 completed bhaiya ji❤

  • @mdfurquanalam786
    @mdfurquanalam786 3 หลายเดือนก่อน

    I have seen a first time a youtuber who always reply (or give heart) on the viewer's comment.. I really appreciate it bhaiya..

    • @procodrr
      @procodrr  3 หลายเดือนก่อน

      Thank you ❤️

  • @vinaypatil8009
    @vinaypatil8009 ปีที่แล้ว +2

    Awesome lecture ☺️ sir.

    • @procodrr
      @procodrr  ปีที่แล้ว +1

      Thanks 😊

  • @SujalKrsoni
    @SujalKrsoni หลายเดือนก่อน +1

    awesome sir , ky bolu sir sabd nhi hai bolne ke liya , aap itna aacha padte hai , love u

    • @procodrr
      @procodrr  2 วันที่ผ่านมา

      ❤️❤️

  • @pubgwala5104
    @pubgwala5104 7 หลายเดือนก่อน +1

    great

  • @akshayiitk4440
    @akshayiitk4440 3 หลายเดือนก่อน +1

    Very good resoucre you are , i wonder why this video has only 2k view

  • @BlinkFacts01
    @BlinkFacts01 4 หลายเดือนก่อน +2

    anonymous ki spelling bahut khatarnaak hoti hai 24:00, waah bhaiya maje aate hai video dekhte samay, baaki clear cut this topic...🤣🤣😂😂

    • @procodrr
      @procodrr  4 หลายเดือนก่อน

      😀😀

  • @prohulkgaming8734
    @prohulkgaming8734 7 วันที่ผ่านมา

    Kha gya mahara MDN, Aaja MDN😁😁, Love you bhai yrrr mja aa gya aapse pdne me to

    • @procodrr
      @procodrr  6 วันที่ผ่านมา +1

      Awesome, keep learning and growing 😊

  • @puspendrasingh3811
    @puspendrasingh3811 ปีที่แล้ว +1

    Very nice sir

    • @procodrr
      @procodrr  ปีที่แล้ว

      Awesome, keep learning and sharing 😊

  • @vikasmv5952
    @vikasmv5952 2 หลายเดือนก่อน +1

    Hi sir ,
    You just explained everything in detailed really like how you explain.
    Just had one doubt
    As we know var , let , const all are hoisted but let and const go yo temporal dead zone and we cannot access it until it is initialized.
    Now just will give 3 examples
    Eg 1
    Let a = 0
    Console.log(a)
    Output = 0
    Eg 2
    Console.log(a)
    Let a= 3:
    Output : cannot access a before initialization.
    Eg 3
    Let a;
    Console.log(a)
    a=2;
    Output : undefined
    I understood 2nd but 3rd as during memory allocation phase a will be undefined and as its declare using let it will go to temporal dead zone and we cannot accept until it is assigned with value , so in this case how we are getting undefined.

    • @SauravKumar-nn1xv
      @SauravKumar-nn1xv 3 วันที่ผ่านมา +1

      In your third example , javascript engine automatically initialized a variable during memory execution phase with undefined value. Hence it is out of TDZ . 😊

    • @procodrr
      @procodrr  3 วันที่ผ่านมา +1

      This is a good point. I'll make a video on it and explain in detail.

  • @faijanakhtar4262
    @faijanakhtar4262 หลายเดือนก่อน

    Sir us line ko kya bole ge jaha pe code execution ho jata like var a line me to undefined hota hai uske next line me jab jata hai tab exicute hota hai to us next line ko kya bole ge

  • @teambaaz007
    @teambaaz007 3 หลายเดือนก่อน

    Bhaiya apka js course kafi depth hai kahi kahi hame kuch chije hard lagti hai pr itni achi aur good knowledge Jo intrw time pr kafi important hoti hai ... Voh sab hame abhi hi samjh AA rhi h aur
    Bhaiya Maine js aur bhi channel se study ki hai pr yaha aake Aisa kyu lgta hai ki voh bs hame js project base dikhate h 😂😢
    Itni good knowledge ap hame free mai provide Kara rhe ho thankyou so much sir ❤❤❤
    ❤❤ 😅😊
    And bhaiya mere vs console me voh variable adress search nhi ho rha hai 😢ky Karu Mai ek din bhi kafi preshan ho gya
    Matlb jese apne variable adress search Kiya h vese mere mai variable adress search karne wala option hi nhi AA rha hai bottom side mai 😢 ky Karu btao na bhaiya pls 😢

  • @AvikNayak_
    @AvikNayak_ 11 ชั่วโมงที่ผ่านมา

    itna din ke baad hoisting kya hai wo samaj mein aya hein.

  • @business_ideas3
    @business_ideas3 9 วันที่ผ่านมา +1

    god of js😇

  • @oppomobile-ur4jd
    @oppomobile-ur4jd ปีที่แล้ว +1

    💯

  • @adityasinghh04
    @adityasinghh04 3 หลายเดือนก่อน

    Hoisting mein var aur functions declaration upar shift hone jaisa appear krte hain pr in reality woh upar shift nhi hote hain. Hoisting mtlb variable can be accessed before it is declared and initialized.

  • @tilak4009
    @tilak4009 3 หลายเดือนก่อน

    Can you give a clear definition of hosting

  • @haseebz124
    @haseebz124 2 หลายเดือนก่อน

    ❤❤❤

  • @Faizan_Iqbal07
    @Faizan_Iqbal07 3 หลายเดือนก่อน

  • @i_m_sonu
    @i_m_sonu 27 วันที่ผ่านมา

    Theory complete

  • @mysightofficial
    @mysightofficial 2 วันที่ผ่านมา +1

    anonymous ki spelling bahot khatranaak hoti hai 🤣🤣🤣

    • @procodrr
      @procodrr  2 วันที่ผ่านมา

      😀😀

  • @Abhisheksoft
    @Abhisheksoft ปีที่แล้ว

    Immediately invoke function (function {}());

  • @kovarathinans3109
    @kovarathinans3109 3 หลายเดือนก่อน

    Sir why can't you make it in English 😢 i Regularly watch your interview sessions i gained lots of knowledge from that, But here language barrier 😢