Skills101
← All practice quizzes

Quiz: Async JavaScript

5 questionsNo time limitPass: 60%+10 XP on first pass

Why JavaScript doesn't freeze while waiting, the event loop as a picture, callbacks vs promises vs async/await, error handling, Promise.all and calling APIs with fetch.

Log in to take the quiz

Free account · see your score, answers and explanations, earn XP

  1. Question 1

    In what order does this print the letters?

    setTimeout(() => console.log("A"), 0);
    Promise.resolve().then(() => console.log("B"));
    console.log("C");
    
  2. Question 2

    What does an async function always return?

  3. Question 3

    fetch() to a URL that returns HTTP 404. What happens?

  4. Question 4

    Which runs three independent requests in parallel and waits for all?

  5. Question 5

    What does this print?

    async function f() { return 5; }
    f().then((v) => console.log(v + 1));