Swift - stride

func stride<T>(from start: T, to end: T, by stride: T.Stride) -> StrideTo<T> where T : Strideable

func stride<T>(from start: T, through end: T, by stride: T.Stride) -> StrideThrough<T> where T : Strideable

Found these pretty useful Swift functions the other day…

for countdown in stride(from: 3, through: 1, by: -1) 
{
    print("\(countdown)...")
}

// 3...
// 2...
// 1...