Created
November 14, 2017 05:49
-
-
Save kuanyingchou/b87b1926142ad21fd1378cbc992f6fed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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