Avatar ·

How to iterate over an array with index and element in Swift (analog of enumerated)

Hello! I just started learning Swift and encountered a typical task: I need to iterate through an array and get not only the element itself at each iteration, but also its index (position in the array). In other languages, I'm used to the classic for loop with a counter, for example, for i in 0..