โจ C# 12 introduced Collection Expressions
It's a cleaner, more expressive syntax for initializing arrays, lists, spans, and even ImmutableArrays using simple square brackets `[ ]`.
The spread operator `..` lets you merge existing collections inline.
No more chaining `.Concat()`, `.Append()`, and `.ToArray()` just to combine two arrays.
ALT A coding tutorial slide titled ".NET Initialize like a boss using collection expressions" against a blue and purple gradient background. The main content is a dark purple rectangle showcasing C# code snippets. The top section, labeled "Collection initialization from C# 12 (.NET 8) ๐", demonstrates initializing `productsOnSale`, `sponsoredProducts`, and `allProducts` string arrays using concise collection expressions, including spreading existing arrays. The bottom section, labeled "And before ๐", shows the equivalent but more verbose initialization using `new[]`, `.Concat()`, `.Append()`, and `.ToArray()` methods. The slide contrasts the modern C# 12 syntax with previous versions for collection initialization. The bottom right corner features "QUICK TRICKS DEV" branding.