Skip to content

Instantly share code, notes, and snippets.

@RinniSwift
Last active May 7, 2019 04:51
Show Gist options
  • Save RinniSwift/b8008ab88bc824191074231aa95573a8 to your computer and use it in GitHub Desktop.
Save RinniSwift/b8008ab88bc824191074231aa95573a8 to your computer and use it in GitHub Desktop.
let array = ["Hello", "people", "of", "the", "world"]
// looping using count property
for ind in 0..<array.count {
print(ind)
}
// 0, 1, 2, 3, 4
// looping using the endIndex property
for ind in 0..<array.endIndex {
print(ind)
}
// 0, 1, 2, 3, 4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment