Answers for "node js make async call inside map"

0

async map js

const arr = [1, 2, 3];

const asyncRes = await Promise.all(arr.map(async (i) => {
	await sleep(10);
	return i + 1;
}));

console.log(asyncRes);
// 2,3,4
Posted by: Guest on August-22-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language