How to iterate a loop with index and element in Swift
Asked 07 September, 2021
Viewed 1.2K times
  • 56
Votes

Is there a function that I can use to iterate over an array and have both index and element, like Python's enumerate?

for index, element in enumerate(list):
    ...

16 Answer