The example is wrong, The "return" inside setTimeout does NOT return on behalf of the function. It is the return of the arrow function inside. Therefore the function returns nothing no matter when. There is no way to "return" asynchronously without using Promise or callbacks
1
u/hinsxd Dec 04 '20
The example is wrong, The "return" inside setTimeout does NOT return on behalf of the function. It is the return of the arrow function inside. Therefore the function returns nothing no matter when. There is no way to "return" asynchronously without using Promise or callbacks