Javascript Nuggets - Promises Example

Поделиться
HTML-код
  • Опубликовано: 9 фев 2025
  • Javascript Nuggets - Promises
    Source Code - github.com/joh...
    Project Based Web Dev Courses
    www.johnsmilga...
    Products I Use:
    Microphone - Shure SM7B - amzn.to/3fX55aD
    Headphones - Shure AONIC 50 - amzn.to/3zbkxHC
    Desk-Mounted Microphone Stand - amzn.to/3x3MBuS
    Crossover - dbx 234s - amzn.to/3xcryGC
    Audio Interface - Focusrite Scarlett 2i2 3rd Gen - amzn.to/3pt1wMx
    Cheaper Microphone (My first mic) - Blue Yeti USB Mic amzn.to/3iliwTm
    Blue Light Blocking Glasses - amzn.to/3fZASrv
    Apple MacBook Pro 13.3" - amzn.to/3z5QDEK
    iMac - amzn.to/3glWmOe
    Second Monitor - LG 4K UHD 27UD88 - amzn.to/3ckdwdV
    Wifi Router - TP-Link AC1900 - amzn.to/34ZSddz
    Desk Chair - amzn.to/3ikNbQJ
    Standing Desk - amzn.to/3zdKVAJ
    Books I Recommend:
    The Subtle Art of Not Giving a F*ck - amzn.to/3v9t8Yi
    The Tipping Point - amzn.to/3gCslKj
    Atomic Habits - amzn.to/3x52xNa
    12 Rules for Life - amzn.to/3gln8pN
    Deep Work - amzn.to/3cyAgqu
    Digital Minimalism - amzn.to/3gao69A
    A World Without Email - amzn.to/351Swoe
    Rich Dad Poor Dad - amzn.to/3v8RWQ6
    Rich Dad's Cashflow Quadrant - amzn.to/3ivt1Uk
    Check out My Amazon Store for more products and books recommendations - www.amazon.com...
    Disclosure: This video is not sponsored. Some links above are affiliate links, and l may earn a small commission from any purchases at no additional cost to you. Thank you for supporting my channel!

Комментарии • 33

  • @codelery414
    @codelery414 3 года назад +6

    Well, if John Smilga gives an explanation on something, understanding is guaranteed. Thanks for another demystification.

  • @CoderDmitri
    @CoderDmitri 3 года назад +5

    John Smilga for president!

  • @juicetheballer
    @juicetheballer 3 года назад +2

    I appreciate all these videos

  • @udaysharma444
    @udaysharma444 3 года назад +5

    Best ever explanation

  • @MIDNightPT4
    @MIDNightPT4 3 года назад +5

    Gifted teacher… Thanks!!

  • @Jacksons_are_jackson
    @Jacksons_are_jackson Год назад +1

    brillant teacher omg

  • @faycal7929
    @faycal7929 3 года назад +2

    it's like callback hell ... but in a fancy way!

  • @youcefkellali751
    @youcefkellali751 2 месяца назад

    the best one in javascript

  • @sohamvishwas6795
    @sohamvishwas6795 2 года назад +1

    Thank you for sharing your knowledge

  • @my_vk_vlogs
    @my_vk_vlogs 3 года назад +1

    Nice video to understand the promise

  • @codex8797
    @codex8797 3 года назад +2

    Nice bro.

  • @AhmedIbrahim-fi2so
    @AhmedIbrahim-fi2so 3 года назад +2

    ooo thanksss ❤️❤️❤️

  • @4t196
    @4t196 2 года назад

    At 11:50 line 14, the last call off addColor didn’t receive the 4th parameter "data".
    Doesn’t JavaScript complain about this?

    • @Han-ve8uh
      @Han-ve8uh 2 года назад

      Mismatch between interface of javascript parameters and arguments passed are fine. Extra arguments are ignored, missing arguments are set to undefined if no defaults setup

  • @ozankurucu6261
    @ozankurucu6261 Год назад

    Thanks

  • @saulchipwayambokoma3213
    @saulchipwayambokoma3213 Год назад

    My headings are still going ahead at their pre-set times. they are not waiting for the previous one to carry out it's action first

  • @ramborb8795
    @ramborb8795 2 года назад

    Can somebody tell me, on MENU project, why the border on the filter buttons have the border color left and up gold and right and down black ? I inspected the buttons, I changed the colour, but still half has a darker colour that the other. Thank you

    • @ramborb8795
      @ramborb8795 2 года назад

      Sorry, I asked the question at wrong video. I had the videos in a playlist and a new video started

  • @AhmedIbrahim-fi2so
    @AhmedIbrahim-fi2so 3 года назад +2

    i think i know how to do that 🤓🤓🤓 ! we can say resolve ( data ) in the finctio ! and then each time .. we pass the next color in the parameter of ( then ) ! as a data ... then inside the (then ) we pass the data insted of the color argument

  • @rentalabharadwaja8013
    @rentalabharadwaja8013 3 года назад

    Can't we do the same functionality without promise , only with setTimeout??

    • @virusnetic
      @virusnetic Год назад

      yes you can but then it will be a callback hell

  • @anatutech
    @anatutech 2 года назад

    This looks like Promise Hell to me.😁

    • @virusnetic
      @virusnetic Год назад +1

      It's actually not because we don't have rewrite the same functionalities again and again
      we can simply call an function for that

  • @anandoganiya9070
    @anandoganiya9070 3 года назад

    In .then( ) if you don't callback and directly invoke the addColor( ) then even after commenting out resolve the program works fine ,why is that happening?

    • @lamb8086
      @lamb8086 3 года назад

      The program didn’t work fine. Once he commented out the resolve, addColor only worked the first time it was called and never made it to the first .then(). He said if you console.log you would see that the promise would still be pending.

    • @anandoganiya9070
      @anandoganiya9070 3 года назад

      @@lamb8086 you didn't get my point

    • @anandoganiya9070
      @anandoganiya9070 3 года назад

      @@fugitivemind it gets invoked after you trigger the event ,nothing is change only i invoke the function inside .then( ) like .then( addColor( parameters...) ) , that mean even after commenting resolve .then( ) gets executed; it proves that it does not depend on resolve( ) call but yeah the state is still pending;

    • @CodingAddict
      @CodingAddict  3 года назад +3

      Program does not work fine, check the sequence. And the reason for that is because with your suggested setup we invoke addColor(params) right away instead of passing as callback. .then(addColor(params), if you will pass it as a reference .then(addColor), you will see that while the promise is pending it's not going to be invoked.

    • @anandoganiya9070
      @anandoganiya9070 3 года назад

      @@CodingAddict no it works I run the code