Junior — Senior
Creating a pause (sleep) function
livecode
Task condition
It is required to implement a function sleep that takes one argument — the number of milliseconds, and returns a Promise object. This Promise should transition to the resolved state after the specified time interval.
Example of usage:
sleep(2000).then(() => console.log('2 seconds have passed'));