📜  ts await foreach 循环 - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:22.936000             🧑  作者: Mango

代码示例3
public async Task RunAsync()
{
    var tasks = new List();
 
    foreach (var x in new[] { 1, 2, 3 })
    {
        var task = DoSomethingAsync(x);
        tasks.Add(task);
    }
 
    await Task.WhenAll();
}