Code hoisting in javascript

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

КОМЕНТАРІ •

  • @HiteshCodeLab
    @HiteshCodeLab  4 роки тому +9

    Full course is FREE and will be available here
    courses.learncodeonline.in/learn/Complete-Javascript-course

    • @rbk.technology4747
      @rbk.technology4747 4 роки тому

      It's a fantastic explanation told in no Js course I saw on utube .
      Then I don't know why does people dislike this video?? I liked it.

    • @ankushladani496
      @ankushladani496 2 роки тому

      Sir plz reply me on instagram.

  • @gopalukani6526
    @gopalukani6526 4 роки тому +29

    I am waiting every single days of new video of this js series. ❤️

  • @sethfrady9334
    @sethfrady9334 4 роки тому +10

    Hitesh you are the best PROGRAMMING teacher on YT hands down! I love how I can watch short videos each day rather than watching a 4 hour JS Basics tutorial. It allows me to actually grasp the concepts and principles rather than flying through it and tiring myself out! Thank you!

  • @codingcage5906
    @codingcage5906 3 роки тому +2

    If you digest everything what he explained in this video, You have understood half of js , Thank you for such a amazing video

  • @mohammedkalifa8948
    @mohammedkalifa8948 4 роки тому +6

    Best ever explanation for js context.Even after i finished my first react project your js series giving me a lot of basic knowledge thank u sir♥️

  • @vijaynavale3919
    @vijaynavale3919 4 роки тому +3

    Watching and applying this concepts again and again while coding is actually fun.

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

    the way of explain the topics is soo wonderful . you are the best teacher of java script.. you use the practical knowledge so it is very easy to understand all the topics . sir i request to make a full stack series separately . thanks sir from the bottom of my heart ........................................................

  • @rbk.technology4747
    @rbk.technology4747 4 роки тому

    It's a fantastic explanation told in no Js course I saw on utube .
    Then I don't know why does people dislike this video?? I liked it.

  • @hitenchawda6443
    @hitenchawda6443 4 роки тому +9

    Well well well , new day new morning
    But incomplete without a js video !
    #YourVideosAreMoreAddictiveThanCaffeine

  • @gopinatht305
    @gopinatht305 4 роки тому +1

    who cares about the duration... if you get explanation like this 😍

  • @yendrembamrabinchandra476
    @yendrembamrabinchandra476 4 роки тому

    This video helps me to clear why I ran into problems dealing with hoisting.

  • @visheshgupta4990
    @visheshgupta4990 10 місяців тому +1

    Thank you very well explained , I learned something new and understand the concpet more deeply , Thanks alot 🙌

  • @gomzysharma
    @gomzysharma 3 роки тому

    I'm watching your videos since morning and know I'm loving both your videos and JS. I'm in love with JS and am so amazed at how beautiful is this and way different from the rest languages.
    I bought paid course worth 15k but found it not that much worthful than these friendly paced videos.

  • @riteshpuley2891
    @riteshpuley2891 4 роки тому +4

    U making javascript so easy.

  • @noorahmedmazumder5021
    @noorahmedmazumder5021 3 роки тому

    Aise lag raha hai jaise ki class mai bhietkar dekrahahu 😍
    Thanks sir for this amazing course 😍

  • @dennyage4791
    @dennyage4791 4 роки тому +1

    Omg it's too interesting ....this gonna create huge bug for beginners if they don't watch your videos🤗🤗

  • @SathishKrishnan
    @SathishKrishnan 4 роки тому

    Thank you for explaining in simple and effectively. Now i don't get confused in JS hoisting.

  • @paulsnehasish5830
    @paulsnehasish5830 4 роки тому +1

    the last example about the variable name = "Hitesh" and function variable name = "Mr. H" is similar to the concept of Local Variable scopes in C and other languages

  • @shahj786
    @shahj786 4 роки тому

    Finally you have resolved my project bug. And thanks for making me understand why the error I was getting.

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

    It's called a function expression, like when you declare a variable, let,var, const only you are storing a function inside of it.
    Javascript treats it like any other variable and assigns it to the call stack and it's value to the stack memory instead of the heap memory where all the other reference data type pointers are stored ( arrays, objects, functions ).

  • @kirankamath5891
    @kirankamath5891 4 роки тому

    That line was good, function declaration are scanned and made available while variable declaration are scanned and made undefined.

  • @nishanttheprogrammer9486
    @nishanttheprogrammer9486 4 роки тому +12

    Super, nobody told me this thing earlier

  • @sridharsethu
    @sridharsethu 4 роки тому +3

    this is same as modularity, function and variable scope; more specifically the code between curly braces { } in C language; but Yes for a JS kind of language, this is great.

  • @nodea4646
    @nodea4646 4 роки тому

    at 13:21 if you declare a variable using a var, it will return undefined but if you declare a variable using let or const, it will return it was never defined!

  • @kirubel_t7150
    @kirubel_t7150 3 роки тому

    It was rather a simple , brief and precise video u r such an amazing guy

  • @realjayjobes1849
    @realjayjobes1849 4 роки тому

    Anyone have any idea how to do a vanilla, javascript only, game "winStreak" counter? So "winStreak" starts as 0, then if someone wins (winning is as easy as pushing the "win" button (a link in a list of links)) *win == 1*, it adds one to the "winStreak" but if someone loses *lose == 0*, it sets "winStreak" back equal to 0- then console.log("Win Streak:" + winStreak + ".")? I've tried like 5-7 different solutions and the furthest I can get is a "winStreak" of 1 no matter how many times I win.

  • @amanprajapati3417
    @amanprajapati3417 3 роки тому

    Is waali video me ais tes ho gyi 😭😭
    But I understood everything 😀😀😀
    Thanku sir❤️

  • @Ravi-oh8xz
    @Ravi-oh8xz 2 роки тому

    Very precisely explained!! Loved it❤️❤️

  • @farrukhzaman3444
    @farrukhzaman3444 4 роки тому

    here comes the legend of programming Mr hitesh love from pakistan

  • @vishwashdwivedi9469
    @vishwashdwivedi9469 4 роки тому

    Seriously , a fantastic thing to learn !.. . I thought I knw javascript before watching this.😂😂😂

  • @snghnishant
    @snghnishant 4 роки тому

    The best video about hoisting so far.

  • @kolawoleomotosho3073
    @kolawoleomotosho3073 3 роки тому

    finnaly i get to understand this concept of hoisting. Thank you so much

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

    Wow I just loved the way you explained ✨️.

  • @timtom3403
    @timtom3403 4 роки тому +2

    sir i have some doubts ,i had watched your python web automation video,i tried to automate google meet,everything is working well except when i join the meet with the join id,i switch to the child node correctly and interacted with evry element,algood,except the alert box on the chld window can not be closed,it says no such alert,the alert requests for cam mic permission whcih in want to dismiss,Stuck for two days?any suggestion

    • @timtom3403
      @timtom3403 4 роки тому +1

      i tried wait methods too still no luck

  • @aashiqahmed5273
    @aashiqahmed5273 4 роки тому +1

    10:20 function expressions

  • @harshitbadaya
    @harshitbadaya 4 роки тому

    Thank you so much hitesh 🚀Your explanation technique and the simplicity for the topic is just wonderful, you make my concept very much much clear to javascript specially this context,Hoisting..
    Thanks man ,More power to you👌👍🏻

  • @yashvardhancn44
    @yashvardhancn44 4 роки тому +1

    that was a nice way of explaining the execution context through big tipper.... :-)

  • @y.s.jenifersingh2153
    @y.s.jenifersingh2153 4 роки тому

    U r really made it man,.... Too easy

  • @SHUBHAMGUPTA-br2jx
    @SHUBHAMGUPTA-br2jx 4 роки тому +2

    what if a function needs something from the global context?

    • @vijaynavale3919
      @vijaynavale3919 4 роки тому

      Then just call that variable or method name that you want global context will provide it to you if defined it, no need to create variable again

  • @shrutianand719
    @shrutianand719 4 роки тому

    Really great video sir finally i understood crazy concept of global variable

  • @shaileshraj2877
    @shaileshraj2877 3 роки тому

    you are just a great coach 💌💌

  • @emrannaziremon5503
    @emrannaziremon5503 2 роки тому

    Great explanation ever❤❤

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

    your explaining was awesome I loved it

  • @it_59_ashishkumarsharma30
    @it_59_ashishkumarsharma30 2 роки тому

    console.log(name);
    doing it in the global scope shows name is deprecated, why? and how can i resolve this?

  • @Sushil2874
    @Sushil2874 4 роки тому

    Rock solid explanation..!!
    Keep going..!!

  • @ashirbadbehera5544
    @ashirbadbehera5544 4 роки тому

    Wow-what an explanation...amazing

  • @Gyaan722
    @Gyaan722 4 роки тому

    Crystal Clear 🔥

  • @DilipKumar-zd2xr
    @DilipKumar-zd2xr 4 роки тому

    In Variable Hoisting, if we try to access before declaration it will return undefined right? But for me when I try with string datatype, it is returning a value. Can you explain this?

  • @chethann1729
    @chethann1729 4 роки тому +2

    very good tutorials

  • @nilamrakholiya5650
    @nilamrakholiya5650 2 роки тому

    It was really interesting one . Thank you sir.

  • @prabhatsingh2606
    @prabhatsingh2606 4 роки тому

    Sir this is amazing i loved this series

  • @josephmbote4167
    @josephmbote4167 4 роки тому

    Wow !! What a great tutorial , I loved it

  • @alltech-jg9hi
    @alltech-jg9hi 4 роки тому

    confusing concept but very important in terms of processing and sequence

  • @priyanshusarkar7777
    @priyanshusarkar7777 4 роки тому

    best explanation for hoisting.

  • @ujjawalchatterjee
    @ujjawalchatterjee 4 роки тому

    Brilliant video at such a perfect time...

  • @anilnigam1200
    @anilnigam1200 3 роки тому

    thanks alott sir for teaching us in such a great way

  • @rindam.b
    @rindam.b 2 роки тому

    if we replace var name with let name, why does it give an error instead of undefined?

  • @vraj3115
    @vraj3115 4 роки тому

    #17minutesJS day 17! wooow finally it goes above 10 min 😅
    10:52 What MumboJumbo thing are you talking about ??
    You taught that so easily !

  • @vishalgawade1436
    @vishalgawade1436 4 роки тому

    instead of parseInt you can simply use + operator eg- let bill = +a ;

  • @codelightsparkles2403
    @codelightsparkles2403 4 роки тому

    great video! could we have a video on how you costumized your vs code? colors ,themes and everything

  • @ganeshchowdhary3024
    @ganeshchowdhary3024 4 роки тому

    Awesome! I learned a new concept today

  • @ankitr2969
    @ankitr2969 4 роки тому

    does context means scope

  • @sheikhfajlayrabbi6070
    @sheikhfajlayrabbi6070 4 роки тому

    I am enjoying this video series sir jii

  • @hasanraja5778
    @hasanraja5778 4 роки тому

    Super context content❤❤😍

  • @raghavgupta6186
    @raghavgupta6186 4 роки тому

    If we try to change the name variable inside function without declaring it using var , then it would refer to the lower context name variable .
    Eg in sayName if we don't declare namme variable again using var , then it will refer to global context for that variable?

  • @jaskaranbhatia2008
    @jaskaranbhatia2008 4 роки тому

    Best Explaination.....nailed it.

  • @ankushthakur2177
    @ankushthakur2177 4 роки тому

    Awesome, i never thought about it

  • @MrAshishkhanal
    @MrAshishkhanal 4 роки тому

    You are teaching very good, really appreciate. But in 2020 we are still using var wouldn't be better if we use ES6.

  • @keshavgupta6549
    @keshavgupta6549 4 роки тому +2

    Thank you bhaiya

  • @BestPlayer07
    @BestPlayer07 4 роки тому

    Thanks for a bit longer video

  • @upulieh
    @upulieh 4 роки тому +1

    What's this code editor? Looks smooth 😅

  • @tusharmehta3411
    @tusharmehta3411 4 роки тому

    Loved the explanation!!

  • @biratpoudel
    @biratpoudel 4 роки тому

    variable'ish functions is called function expressions.:)

  • @dennyage4791
    @dennyage4791 3 роки тому

    Awesome explanation sirr

  • @aayush5474
    @aayush5474 4 роки тому

    i need to know about these extensions

  • @fahimalif4068
    @fahimalif4068 4 роки тому

    I just became a fan of your vs code theme and file icon theme.please share your vs code theme and file icon theme with us please

  • @ASHISHSINGH-gs3yt
    @ASHISHSINGH-gs3yt Рік тому

    Local Variable and global variable words would have made Context things so easy to understand.
    Anyways Good content. Thanks.

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

    Splendid job sir

  • @aayush5474
    @aayush5474 4 роки тому

    hello sir, i know nodejs for server side but i see that many companies and internships are asking for php. So should i learn php now as well?

  • @bhavesh2952
    @bhavesh2952 3 роки тому

    Thank you buddy very well explained :)

  • @Learner010
    @Learner010 4 роки тому +2

    Great !

  • @saharshnigam6526
    @saharshnigam6526 4 роки тому +1

    This series is really turning out to be different

  • @shanny104
    @shanny104 4 роки тому

    Thanks for this interessant video, sir can you give us some tips on how to improve problem-solving skills, and give us some exercise after some videos, thanks a lot

  • @arnabnandi2009
    @arnabnandi2009 4 роки тому

    why are we not using keyword "let" ?
    It seems when I used the same example with "let" , it doesnt assign "undefined"
    rather it counts it as not being declared at all

    • @bobbyreddy1301
      @bobbyreddy1301 3 роки тому

      "let" is used to define block-level of scop

  • @nithishkarthik9163
    @nithishkarthik9163 4 роки тому

    such an amazing content!!

  • @shamshaque1914
    @shamshaque1914 4 роки тому

    Hey, thanks for this amazing video😊, it would be great if you would have covered class hoisting too😅

  • @imamansoni
    @imamansoni 4 роки тому

    Pretty interesting things are in js

  • @tejkumarkempaiah4906
    @tejkumarkempaiah4906 2 роки тому

    Hi Hitesh,
    Good Afternoon :-)
    Is the global execution context the same or different when we execute the js in browser and inside an VS editor?
    Because, The below code yields different results when executed at browser console and in Visual code(node.js) env.
    console.log(name) //undefined
    var name = "hoisting";
    function greet(){
    console.log(name); //undefined
    var name = "function hoisting";
    console.log(name); //function hoisting
    }
    greet();
    console.log(name); //hoisting
    -----------------------------------------
    Browser console output:
    hoisting
    undefined
    function hoisting
    hoisting
    -----------------------------------------
    Out of node.js(Visual Studio Code:)
    undefined
    undefined
    function hoisting
    hoisting
    -----------------------------------------
    Please suggest.

  • @myselfsohit
    @myselfsohit 4 роки тому +1

    #enjoyed a lot :) i love to watch long videos haha ...can u use my name as an example in any of your upcoming video for a singe tym...
    😃😃😃😃

  • @chasing_rainbowz
    @chasing_rainbowz 4 роки тому

    Great explanation!

  • @armanahmed4806
    @armanahmed4806 4 роки тому

    Amazing juz love it...

  • @kapilchhabra3028
    @kapilchhabra3028 4 роки тому

    Amazing!, Love it...

  • @Fahadkhan_313
    @Fahadkhan_313 4 роки тому +3

    Where is the playlist man 😂.

    • @HiteshCodeLab
      @HiteshCodeLab  4 роки тому +3

      courses.learncodeonline.in/learn/Complete-Javascript-course

    • @Fahadkhan_313
      @Fahadkhan_313 4 роки тому +1

      Thanks I know about the UA-cam issue of showing double videos in playlist.lot of love from India.

  • @VishalSharma-rn7mt
    @VishalSharma-rn7mt 4 роки тому

    Awesome video sir

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

    Please explain hosting

  • @novanoskillz4151
    @novanoskillz4151 3 роки тому

    great stuff here!!

  • @AmitKumar-vh6ty
    @AmitKumar-vh6ty 4 роки тому

    Great explanation

  • @nishantjadhav416
    @nishantjadhav416 3 роки тому

    Haha i tried this in previous video after context I got this error and Now my doubt is clear😂.

  • @mohitdhami
    @mohitdhami 4 роки тому +2

    I am Slightly getting Confused with Context

    • @vijaynavale3919
      @vijaynavale3919 4 роки тому +1

      See everything you defined is known by global context
      But if you declared function then what ever thing come into it is known by only that function.
      Other variables which is global can't have access of that function declaration.
      You will get clear when you see scope chain video may be he will put it tommorow

    • @ankitrai2437
      @ankitrai2437 4 роки тому

      what is it?

  • @vijaynavale3919
    @vijaynavale3919 4 роки тому

    Keep going 👍