Not surprisingly, C# worlds the same way with the only exception that you have to declare the variables as “var” but they are still strongly typed
Not surprisingly, C# worlds the same way with the only exception that you have to declare the variables as “var” but they are still strongly typed
It's also not quite as easy to declare and build an array. You can't just write
You have to write something like However if you have previously declared `arr` to be of type `int[]` (or another collection type such as `List<int>`), then you can write I haven't used TypeScript so don't know if it distinguishes between arrays and lists, and if so how it determines one or the other in inferred types. Would be curious to know.Technically you're also allowed to use anonymously typed objects as inferred generic typed parameters in method calls.