Notice that the order of iteration is guaranteed only for certain collections such as arrays and List, but not guaranteed for many other collections.

✝ While IEnumerable is typically used to indicate enumerable collections, foreach only requires that the collection expose publicly the object GetEnumerator() method, which should return an object that exposes the bool MoveNext() method and the object Current { get; } property.