I want to make this example https://stackoverflow.com/a/33585993/1973680 synchronous.
Is this the correct implementation?
let times= async (n,f)=>{while(n-->0) await f();}
times(5,()=>
myfunc([1,2,3],err => err)
)
myfunc is itself an async function awaiting for various other functions:
async myfunc(params,cb){
await a( err => err )
await b( err => err )
await c( err => err )
}`
async/awaitdoesn't make code synchronous. It just enables a more convenient way of writing asynchronous code. And yeah, that looks like it should work (why don't you just try it?), although I'd rather writeasync () => await myfunc([1,2,3],err => err).err => errcallback you are passing but not using anywhere does not look like correct usage ofasync functions.