C# For Loops and Iterators Uncovered

from blog nickb.dev, | ↗ original
int[] arr = { 1, 2, 3, 4 }; for (int i = 0; i Console.WriteLine(arr[i]); foreach (int i in arr) Console.WriteLine(i); for (int i = 0; i Console.WriteLine(arr.ElementAt(i)); What are the differences between these loops? They look the same and have the same result. The truth is that they are extremely different and serve different...