About the Call Stack, Event Loop, Callbacks and Promises in JavaScript

Поделиться
HTML-код
  • Опубликовано: 12 сен 2024
  • In this episode we talk about the JavaScript call stack, asynchronous callback functions, and create a Multi Stage Promise Chain using data from the Spotify Web API.
    Key technologies we will touch are:
    * Fetch API
    * Promise API
    * Array.map() and Array.forEach()
    * setTimeout()
    Source code:
    github.com/met...
    Music:
    Demoscene Time Machine
    demoscenetimema...

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

  • @ErnestGWilsonII
    @ErnestGWilsonII 6 лет назад +7

    I wanted you to know that your videos are greatly appreciated even ones like this which are more than a year old. I am a fan of funfunfunction and I just happened to find your Channel and I appreciate the parody. Truth be told I think you are perhaps the best JavaScript programmer posting videos on the internet today. There are several of us still coming up to speed on JavaScript in the Philadelphia Pennsylvania United States region and we watch your videos and learn from them. Some of your recent Mario videos are the best examples of refactoring code I have ever seen. You are a master Craftsman! Thank you for taking the time to make and post these videos. My only complaint would be after I watch your videos I realize how terrible I am at JavaScript. You should consider making a Masters of the Universe JavaScript series and talk about some of the things people fear the most. Every time I watch one of your videos I take away something new and valuable. You are operating at an advanced level and some of the things you do go over my head, but that is what keeps me coming back because I know there is more to learn!

    • @meth-method
      @meth-method  6 лет назад

      Hello EGW, and thank you soo much for your kind words. It makes me so happy to read that.
      Thank you for taking the time to write this to me. It made my day. :D
      Thanks for watching!

  • @mrmagicrapattack
    @mrmagicrapattack 7 лет назад +1

    I absolutely love your videos! They make these things easy and fun to follow. Please come back!

  • @Goofy8907
    @Goofy8907 7 лет назад +18

    Fun Fun Function...
    Meth Meth...aah, I see what you did there :)

    • @thefreeze6023
      @thefreeze6023 5 лет назад

      Methods are functions, so meth is fun?

  • @petraohlin4325
    @petraohlin4325 8 лет назад +7

    Awesome episode!
    Top 3 giggles:
    1. "Blob blob blob blob"
    2. pom in the album id
    3. The end

    • @WiBla
      @WiBla 8 лет назад +1

      1: 36:26
      2: 34:26
      3: 40:30
      ;)

  • @vherever
    @vherever 7 лет назад +6

    We are all waiting for new videos. Keep doing cool stuff!

  • @kazaakas
    @kazaakas 6 лет назад +1

    I suggest anyone who wants to write super clean/readable async code to check videos on ES8's new async/await standard right away!!
    The jump from Promise.then to async/await is as big as the jump from callback hell to Promises!
    Furthermore, I'm not sure whether I'm more happy with the learning about the JS concepts or learning about this amazing electro artist!

  • @kurnander2
    @kurnander2 7 лет назад

    Last one minute is very awesome...Liked the presentation....Please come with more videos...

  • @Patrik-Nilsson
    @Patrik-Nilsson 8 лет назад +1

    Great Video! I was struggling to make a promise chain with angular, but after I watched this video I solved the problem. Thanks =)

    • @meth-method
      @meth-method  8 лет назад +2

      Good to hear! Glad I could help. :)

  • @lilzuma
    @lilzuma 8 лет назад

    Great use of animations, this is exactly what I was looking for!

  • @davidhopkins7785
    @davidhopkins7785 6 лет назад

    These swedes are so good at programming + they really understand it at a deep level. Thanks.

  • @solvm1652
    @solvm1652 6 лет назад

    AWESOME!!! Fantastic tut! It would be cool to get a remake of this with Async Await. Thanks for this great resource!

  • @ovoshawn7081
    @ovoshawn7081 8 лет назад +1

    Great stuff! Looking forward to more videos!

  • @coolworx
    @coolworx 7 лет назад +6

    Please come back soon!

  • @ctrlz4475
    @ctrlz4475 7 лет назад +2

    "blob blob blob blob" that's so funny haha
    really nice video , learns a lot from it
    Please make more when you have time

  • @thefreeze6023
    @thefreeze6023 5 лет назад +1

    Well this was enlightening

  • @X7evenA
    @X7evenA 7 лет назад

    I love your channel buddy, keep up the good work!

  • @ynn66
    @ynn66 8 лет назад

    Hot stuff, congrats.
    I encourage you to make more videos like this.
    Thanks

  • @DeanRadcliffe
    @DeanRadcliffe 7 лет назад +1

    This is fabulous! Your animations of the stack frame are great - would there be a way I could use those?

  • @jmmuci
    @jmmuci 8 лет назад

    Nice! Specially the last part :)

  • @PENDANTturnips
    @PENDANTturnips 7 лет назад +30

    Haha is your name a parody of funfunfunction or the other way around?

    • @sobanya_228
      @sobanya_228 7 лет назад +3

      Just wanted to write the same

    • @MorganEarlJones
      @MorganEarlJones 7 лет назад +1

      rot13("Mattias Petter Johansson") = "Znggvnf Crggre Wbunaffba"
      coincidence? Well, i'm not sure what that coincides with but either way he's the evil MPJ. He even has a mustache.

    • @meth-method
      @meth-method  7 лет назад +10

      It's a parody by name. When Mattias named his show I asked why he didn't call it Meth Meth Method, and when I wanted to do my own the name was a given. I asked for permission. :)

    • @BertvanAltena
      @BertvanAltena 7 лет назад

      Me too :)

  • @wazaabazaa
    @wazaabazaa 7 лет назад +4

    Educational and hilarious!
    >blob blob blob

  • @Goeinavund
    @Goeinavund 6 лет назад

    you should consider scrimba dude! you're very easy to listen to and have a great tempo. Scrimba makes it easier to code along :).

  • @arber10
    @arber10 6 лет назад +1

    Why does the Promise.all just take one second (run all simultaneously)? I thaught, that setTimeout will be „moved“ to a new call stack and JS can proceed just one at the time. Like you showed in the video. So why behaves this different?
    EDIT: I got it now: developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop

  • @DavidKarlsson
    @DavidKarlsson 7 лет назад

    Subbed for the music!

  • @aylictal
    @aylictal 6 лет назад

    You should make a video showcasing how to transform the exact same code above using async await :)

  • @emanonmax
    @emanonmax 7 лет назад +3

    If you are a demoscener come to evoke 21 on aug. 17-19th 2018

  • @jasonreviews
    @jasonreviews 8 лет назад +1

    you teach better than my professor. LOLs.

  • @ryanmindigo7446
    @ryanmindigo7446 8 лет назад

    Incredible

  • @vintagegamerbr214
    @vintagegamerbr214 7 лет назад

    can you do one for TIC TAC TOE for newbies such as myself? There is nothing out there as good as your videos.

  • @georgedicu7397
    @georgedicu7397 7 лет назад

    Hi Method, can you do an explicit+example video on arrow function?!
    Reason:Your explications/examples are very good man!
    Thank you

  • @MahmudulMithun
    @MahmudulMithun 6 лет назад

    Bro I like to know the brand and name of the glasses you are wearing. They look cool

  • @knightOfSun
    @knightOfSun 7 лет назад

    great beard ( pressed like button ) :)

  • @SlimE-lx3ot
    @SlimE-lx3ot 5 лет назад

    which keyboard is that?

  • @fearmear
    @fearmear 7 лет назад

    I believe you can skip the whole "convert from fetch image response to blob" and just append img.src = album.images[0].url

  • @diogoca
    @diogoca 6 лет назад

    Your nickname on url may be a signal: keep going with your episodies :)

  • @EldeNova
    @EldeNova 7 лет назад

    Dude I finally get it now. Thanks. Time to slaughter all those callbacks!.

  • @orangeflowerlove
    @orangeflowerlove 6 лет назад

    Using fetch() no longer works for this tutorial. I got error status code 401. You need to have a clientID and clientSecret to get a token from spotify to access the data. I switched to use the spotify-web-api-node. It should be fine like that.

  • @malducci
    @malducci 4 года назад

    That probably would taken me days to write hahah

  • @SocialFoam
    @SocialFoam 7 лет назад

    Can I download your intro somewhere? I love it!

  • @thefreeze6023
    @thefreeze6023 5 лет назад +1

    He protecc
    He attacc
    But most importantly...
    He don't like callbacc

  • @rolandbrake
    @rolandbrake 8 лет назад

    why you stop making videos?

    • @meth-method
      @meth-method  8 лет назад +2

      I moved and have no recording environment currently. Eager to jump back on though.

    • @rolandbrake
      @rolandbrake 7 лет назад

      Meth Meth Method Eager to see you again

    • @WorstDeveloper
      @WorstDeveloper 7 лет назад

      Just found your channel, you better start making content again soon! :)
      I've subscribed.

  • @emmanuelvalverderamos
    @emmanuelvalverderamos 7 лет назад

    The Spotify API has change

    • @meth-method
      @meth-method  7 лет назад +1

      Emmanuel Valverde Ramos mock it!! :)

  • @dkennell998
    @dkennell998 7 лет назад

    Brrrrp

  • @jasonjellyfish7480
    @jasonjellyfish7480 7 лет назад

    woah...wtf...weed....java....swede....hypnosis();

  • @frais
    @frais 7 лет назад

    great content but horrible intro and irritiaiting mechanic keyboard sound

  • @vherever
    @vherever 7 лет назад

    We are all waiting for new videos. Keep doing cool stuff!