Back
Close

JavaScript promises, mastering the asynchronous

Magus
377K views

Let's do some practice with a simple exercice. You must modify the code below based on the following rules:

  • The function job must return a promise object (you are in a NodeJS environment, you can use new Promise)
  • The promise must resolve itself 2 seconds after the call to job and must provide hello world in the data
Change the code to return a promise
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