DEV Community

Discussion on: Where’s the Sleep Function in JavaScript?

Collapse
 
danielescoz profile image
Daniel Escoz

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

So yes, it works.

Thread Thread
 
aumayeung profile image
John Au-Yeung

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