Skip to main content
The 2026 Annual Developer Survey is live— take the Survey today!.
D G's user avatar
D G's user avatar
D G's user avatar
D G
  • Member for 14 years, 4 months
  • Last seen this week

Profile

Stats

1,752
reputation
218k
reached
13
answers
39
questions
Loading…

About

class Program
{
    public readonly IList<int> data = [1, 2, 3];
    static void Main(string[] args)
    {
        var p = new Program()
        {
            data = { 4, 5, 6 } // appending :-)
        };
        Console.WriteLine(string.Join(",", p.data));
    }
}
static async Task Main()
{
    var f = async (char c) =>
    {
        for (int i = 0; i < 5; ++i)
        {
            Console.WriteLine(c);
            await Task.Yield();
        }
    };

    Console.WriteLine("Begin");
    var a = f('*');
    var b = f('-');
    await Task.WhenAll(a, b);
    Console.WriteLine("End");
}

and

async function Main() {
    let f = async (c) => {
        for (let i = 0; i < 5; ++i) {
            console.log(c)
            await Promise.resolve();
        }
    }
    console.log('Begin');
    const a = f('*');
    const b = f('-');
    await Promise.all([a, b]);
    console.log('End');
}
This user doesn’t have any gold badges yet.
10
silver badges
13
bronze badges
18
Score
28
Posts
54
Posts %
11
Score
5
Posts
10
Posts %
2
Score
2
Posts
4
Posts %
0
Score
5
Posts
10
Posts %
0
Score
3
Posts
6
Posts %
0
Score
2
Posts
4
Posts %

Top posts

View all questions and answers