Loading homepage
Input: await mapAsync([1, 2, 3], async (value) => value * 2) Output: [2, 4, 6]
Input: await mapAsync(["a", "b"], (value, index) => `${index}: ${value.toUpperCase()}`) Output: ["0: A", "1: B"]
Input: await mapAsync([], async (value) => value) Output: []
Input: mapAsync([1, 2], async (value) => { if (value === 2) throw new Error("Unavailable"); return value; }).catch((error) => error.message) Output: "Unavailable"
The examples show awaited results. Real API requests are unnecessary: tests use controlled asynchronous operations.