Async Javascript Tutorial For Beginners (Callbacks, Promises, Async Await).

42
1



Check out my courses to become a PRO!

We are getting closer and closer to launching the Creative Javascript Course. I wanted to share a small portion of the Async Javascript chapter of the course where we will learn everything there is to know about how async code works in javascript.
We are going to take a look at all the popular ways async code is being run such as callbacks, promises and the new async await.

🎁Support me on Patreon for exclusive episodes, discord and more!

Microphones I Use
Audio-Technica AT2020 – (Amazon)
Deity V-Mic D3 Pro – (Amazon)
BEHRINGER Audio Interface – (Amazon)

Camera Gear
Fujifilm X-T3 – (Amazon)
Fujinon XF18-55mmF2.8-4 – (Amazon)

PC Specs
Kingston SQ500S37/480G 480GB – (Amazon)
Gigabyte GeForce RTX 2070 – (Amazon)
AMD Ryzen 7 2700X – (Amazon)
Corsair Vengeance LPX 16GB – (Amazon)
ASRock B450M PRO4 – (Amazon)
DeepCool ATX Mid Tower – (Amazon)
Dell Ultrasharp U2718Q 27-Inch 4K – (Amazon)
Dell Ultra Sharp LED-Lit Monitor 25 2k – (Amazon)
Logitech G305 – (Amazon)
Logitech MX Keys Advanced – (Amazon)

DISCLAIMERS:
I am a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to Amazon.com and affiliated sites.

🛴 Follow me on:
Twitch:
Twitter:
Instagram:
Github:

#programming #javascript

Nguồn: https://alimentproteine.com/

Xem thêm bài viết khác: https://alimentproteine.com/cong-nghe/

42 COMMENTS

  1. Great video. Does a better job explaining all of these concepts than the other async stuff I've seen on YT

  2. Such an amazing and easy explanation of the videos !!! just loved it !!! Would definitely want to learn react from you !

  3. what ever your name is but i really loved your work your down to earth nature and humbleness really amazing maybe thats the reason why people learn fast may be but amazing i saw brad course but your ones are much more than that include humble and down to earth nature appreciate your work from Pakistan. my mentor from now

  4. Callback functions may depend on other callback functions and chains of dependencies like this can become hard to read. The 'hard to read' structure that's formed is known as callback hell. Other JS techniques help make code neater and easier to follow.

  5. So callbacks are needed to tell the program that this callback function must be run after that certain slow process is over. Without callbacks, as the program runs synchronously, processes further down the code that depend on data from slower processes above, will not have that data to run. Callbacks ensure that those later processes are run only after the data returns from the slower processes of the program.

  6. really looking forward to buying your JS course, I've started javascript this week in classes and it's not clicking yet and you explain so well :p

  7. Nice Video Man
    Use Plotly for Android Apps is permitted?
     I wanna use plotly for my analysis in my android app and publish in Google Play Store and IOS AppStore, Is that Acceptable to use plotly inside my Android App as well as IOS App, Or Is there any subscription to use Plotly in Android App,I didn't get into my mind by reading the license, Please answer in layman terms and  answer will be very useful for me.
            Thank you in advance!

  8. Well, I have a question…If I use promise.all on two promises that have a setTimeOut of 2000ms and 5000ms respectively, then will we not get both the output after 5000ms? Cuz in the video setTimeOut having 2000ms logged into the console first, which I wasn't expecting.

  9. I was starting to panick because everywhere I read, I couldn't understand callbacks, promises, async and await. This video has helped me so much. Thank you ed

  10. Hi! thank you for your video, let me know what vscode theme do you use, it looks nice..

  11. What will i do if you will iterate an httpRequest? for my experience. when i put a request inside a loop, it automatically run all the promise at the same time

  12. Hallo sir,
    Can you help me how can i call, the function delay().. in below code.

    async function printme(){
    console.log("start");
    await delay(20000);
    console.log("end");
    }

    function delay(msTodelay){
    …..
    }
    printme();

  13. I think at 18:12 by reusing the parameter name `user` in the callback function might be confusing to some since the variable that the loginUser() is defined on is also named 'user'. I had to do a double take at that wondering why we were passing in the variable definition into the callback when I realized that it was just that they were both named the same thing. It may be clearer to think of the callback function's parameter as `userInput`.

  14. Hi , I have a question:
    how we can do something lilke: let's say
    1. i want to create a user
    2.create a video suggestion list for that user
    3. show that video suggestion list
    in this scenario , let's assume we failed at number 3: and we are telling user try again. but already 1 & 2 action is done. we don't want that.
    we want 3 action need to be done. if any of them is giving error then stop the whole process.
    how to do it in javascript ?please reply

    ======================

    we can't just use if else then if 1 is success then 2 will run then let's say 2 give error( for bad internet connection or anything else ) then 3 can not run but 1 is already done.

LEAVE A REPLY

Please enter your comment!
Please enter your name here