"Komag" wrote:
But I've found that if I use Append(), it creates a new nested array just for ae with the new values:
ae[1].Append(["red","blue])
now only ae will be [ ["red","blue"], [] ]
ac will still be [ [], [] ]
No.
ifList.Append() is a mutator, it changes (as it should be) underlying object, does not create copy:
BrightScript Debugger> X = [ [], [] ]
BrightScript Debugger> ae = X
BrightScript Debugger> ac = X
BrightScript Debugger> ae[1].Append(["red","blue"])
BrightScript Debugger> ? ae[1]
red
blue
BrightScript Debugger> ? ac[1]
red
blue