loading...

re: Where’s the Sleep Function in JavaScript? VIEW POST

TOP OF THREAD FULL DISCUSSION
re: The docs say it only works if the original function takes the callback as the final argument, setTimeout takes the callback as the first argument. ...
 

Functions can define their own promisified version using a symbol, which is what setTimeout does in Node.js

So yes, it works.

That makes sense. Good to know if we're using Node.js

code of conduct - report abuse