3 ms·
That's what I thought. But then, unless foo2() is an async function, the entire thread that's running foo2() will be blocked, will it not?
by TeMPOraL 3y ago
That's what I thought. But then, unless foo2() is an async function, the entire thread that's running foo2() will be blocked, will it not?
- brundolf 3y agoNope. It returns a promise, which other logic can then hang a callback off of. But the promise is returned immediately (if just resolves and calls the callback later, like any event listener would)