Array.fromAsyncadvancedconst nums = [1, 2, 3]
const doubled = await Array.fromAsync(nums, async n => n * 2)
// β [2, 4, 6]Pass an async mapping function to Array.fromAsync() to transform each element as it resolves.
Like Array.from(), Array.fromAsync() accepts an optional mapping function as its second argument. The mapper can itself be async (returning a promise).
This exercise simulates the pattern synchronously.
Challenge: Implement doubleAll that doubles every number in an array using Array.from with a mapping function.
doubleAll([1, 2, 3]) // β [2, 4, 6]