C# iterators use foreach
instead of for
. Also, notice the variable declaration within the for
/foreach
statement. C# requires the type of the item contained in the list to be explicitly declared.
JavaScript:
for (var item in itemList) { item.DoSomething(); }
C#:
foreach (ItemType item in itemList) { item.DoSomething(); }
JavaScript:
3.144.113.163