Skip to content

Instantly share code, notes, and snippets.

@yojkim
Created January 1, 2021 13:12
Show Gist options
  • Save yojkim/aa960acb2a0d6a4a20add72428d8d82c to your computer and use it in GitHub Desktop.
Save yojkim/aa960acb2a0d6a4a20add72428d8d82c to your computer and use it in GitHub Desktop.
more safe way to access array in swift - 1
let arr = [1, 2, 3, 4]
arr[4] // Fatal error: Index out of range
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment