jeudi 22 novembre 2018

What is the meaning of new { } (without [])?

I'm doing a kinda-like research project on NUnit for class, and our teacher wrote this test:

[Test]
    public void ObjectLiteralIsAnObject ()
    {
        Assert.AreEqual (true, new { } is Object);
    }

I know the meaning of new[]{}, it creates an array of the best assignable type given the values you insert between {}. But what does new { } do? Is it just the same, or is there a small difference?

Thank you so much in advance, and sorry if it's a silly question!

Aucun commentaire:

Enregistrer un commentaire