Collections and iteration
C# collections are the same shapes you know from JS, with explicit types and interface-first return types. Learn the three you'll touch most and the rest follow.
The difference from JS is that the element type is part of the type: List<int> is a list of ints and nothing else can go in. That <T> is a generic type parameter, the same idea as TS Array<T> or Map<K, V>, and it's enforced by the compiler.
Iteration is foreach, which is for...of.
Now the Fusion habit that surprises TS developers: methods usually return the interface, not the concrete collection. You'll see IReadOnlyList<T>, IReadOnlySet<T>, and IEnumerable<T> on return types far more than List<T>.
The method builds a HashSet internally but returns IReadOnlySet<string>. The caller can enumerate it and check membership, but can't add or remove, so the store's data can't be mutated from outside. This is "program to the interface": expose the smallest contract that does the job.
Try it yourself
The collection dictionary
Map the three you'll use daily.
What are the C# equivalents of a JS array, a `Map`, and a `Set`, and what does `IReadOnlyList<T>` signal on a return type?
Why return the interface
A query store method returns IReadOnlySet<string> instead of HashSet<string>. Why?