Array.fromAsyncadvancedconst set = new Set([10, 20, 30])
const arr = await Array.fromAsync(set)
// β [10, 20, 30]Array.fromAsync() also works with synchronous iterables like Set or Map.
Array.fromAsync() is not limited to async iterables. It also accepts sync iterables (like plain arrays or Sets), returning a Promise that resolves to the collected elements. This makes it a drop-in for Array.from when you need a Promise regardless.
This exercise demonstrates the pattern synchronously using Array.from on a Set.
Challenge: Implement syncToArray that converts a Set<number> to an array using Array.from.
syncToArray(new Set([1, 2, 3])) // β [1, 2, 3]