Last active
February 24, 2019 01:02
-
-
Save commy2/d0af36ba7b839eb8eb93874b08dcab2e 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
private _origSubarray = [0, 1, 2]; | |
private _origArray = [_origSubarray]; | |
private _refCopy = _origArray; | |
private _deepCopy = + _origArray; | |
private _flatCopy = [] + _origArray; | |
_origSubarray pushBack 4; | |
_origArray pushBack ["a", "b", "c"]; | |
systemChat format ["Reference Copy: %1", _refCopy]; // [[0,1,2,4],["a","b","c"]] | |
systemChat format ["Deep Copy: %1", _deepCopy]; // [[0,1,2]] | |
systemChat format ["Flat Copy: %1", _flatCopy]; // [[0,1,2,4]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment