The Modern JavaScript Bootcamp (2019) - Async/Await Challenge

The Modern JavaScript Bootcamp (2019) - Async/Await Challenge

Assessment

Interactive Video

Information Technology (IT), Architecture

University

Practice Problem

Hard

Created by

Wayground Content

FREE Resource

The video tutorial covers the process of converting regular JavaScript functions to async functions using the async/await syntax. It includes challenges that require converting 'getCountry' and 'getLocation' functions, ensuring no changes are needed in the main application code. The tutorial also guides on creating a new function 'getCurrentCountry' that combines async functions to simplify code. Testing and optimization techniques are discussed to ensure the new async functions work as expected.

Read more

10 questions

Show all answers

1.

OPEN ENDED QUESTION

3 mins • 1 pt

What are the two steps required to convert the 'get country' function to an async function?

Evaluate responses using AI:

OFF

2.

OPEN ENDED QUESTION

3 mins • 1 pt

What is the significance of using 'await' with the fetch call in the async functions?

Evaluate responses using AI:

OFF

3.

OPEN ENDED QUESTION

3 mins • 1 pt

What should be done if the response status is not 200 in the 'get country' function?

Evaluate responses using AI:

OFF

4.

OPEN ENDED QUESTION

3 mins • 1 pt

Explain how the 'await' operator is used in the context of the 'get country' function.

Evaluate responses using AI:

OFF

5.

OPEN ENDED QUESTION

3 mins • 1 pt

What changes were made to the 'get location' function to convert it to an async function?

Evaluate responses using AI:

OFF

6.

OPEN ENDED QUESTION

3 mins • 1 pt

Describe the purpose of the new function 'get current country'.

Evaluate responses using AI:

OFF

7.

OPEN ENDED QUESTION

3 mins • 1 pt

In what way does the new async function simplify the code compared to the previous implementation?

Evaluate responses using AI:

OFF

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?