Back
Close

JavaScript promises, mastering the asynchronous

Magus
37.9K views

The code snippet below is synchronous. It calls callback1 one time and callback2 three times. You must modify this code to make it asynchronous with the following rules:

  • callback1 must be called only one time, after 2 seconds.
  • callback2 must be called three times with an interval of 1 second.
Change the code to make it asynchronous
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(callback1, callback2) {
callback1();
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