Skip to content

Instantly share code, notes, and snippets.

@kuanyingchou
Created November 14, 2017 05:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kuanyingchou/b87b1926142ad21fd1378cbc992f6fed to your computer and use it in GitHub Desktop.
Save kuanyingchou/b87b1926142ad21fd1378cbc992f6fed to your computer and use it in GitHub Desktop.
var data = [[1, 2, 3], [4, 5, 6]]
var index = 0
print(data[0])
print(data[1])
index = 0
data[index].remove(at:0)
print(data[0])
print(data[1])
index = 1
data[index].remove(at:0)
print(data[0])
print(data[1])
/*
result:
[1, 2, 3]
[4, 5, 6]
[2, 3]
[4, 5, 6]
[2, 3]
[5, 6]
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment