If I have three types of functions.
-
synchronous function
function a(){ return "a"; }
-
callback function
function b(callback){ setTimout(callback(b), ) setTimeout(() => { callback(b); }, 10); }
-
Promise function.
function c(){ return new Promise.resolve('c') }
How can we combine the result of all 3 in a single promise. like Can we create a function, which can return ['a', 'b', 'c']; I do not want to change these three functions.
how can we combine synchronous function, callback function and promise all together
from how can we combine synchronous function, callback function and promise all together
No comments:
Post a Comment