Chapter quiz · Async, Modules & Errors

Test what you learned.

8 questions on Async, Modules & Errors. Pass 70% to clear the chapter.

← Review chapter lessons

Quiz

Async, Modules & Errors — Chapter Quiz

Eight questions on modules, promises, async/await, fetch, errors, and iterators.

0/ 8
  1. Question 1
    1

    How many default exports can a single ES module have?

  2. Question 2
    2

    What does this code log (eventually)?

    Promise.resolve(1)
      .then(n => n + 1)
      .then(n => n * 10)
      .then(console.log);
    
  3. Question 3
    3

    A fetch() call rejects when the server returns a 404.

  4. Question 4
    4

    Inside an async function, what does await somePromise do?

  5. Question 5
    5

    Which is the right way to run two async calls in parallel and wait for both?

  6. Question 6
    6

    What is logged?

    try {
      null.x;
    } catch (e) {
      console.log(e.name);
    }
    
  7. Question 7
    7

    A generator function (function*) returns an iterator that you can use with for..of.

  8. Question 8
    8

    To consume an async iterable (one yielding promises), use for ____ (const x of stream) { ... }.

Pick an answer — instant feedback as you go.