Back
Close

JavaScript, async and await keywords

Magus
6,222 views
Previous: Some tricks

The following code uses promises to handle an asynchronous result. The result is a promise that yields an id when resolved. This id must be used to retrieve information from the database. In the end, your function must return the name property of the information. In case of an error, you have to return a rejected promise with the given error. But first you must notify the errorManager with the error.

The given code already works. You have to rewrite it to use the async and await keywords.

Resolve the challenge
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io
function job(result, database, errorManager) {
return result
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants