C#C
C#12mo ago
Faker

{} vs [] when initializing an array in C#

Hello guys, is there a difference when we use {} to initialize an array or if we use [] ? I read that the [] is known as a collection expression.

C#

string[] orders = {"B123", "C234", "A345", "C15", "B177", "G3003", "C235", "B179"};

vs

string[] orders = ["B123", "C234", "A345", "C15", "B177", "G3003", "C235", "B179"];
Was this page helpful?