Hi, I'm working on pulling data from a dictionary. However, when I modify the variable 'myarray', It's modifying the dictionary as well, and it's driving me crazy. Any advice on how I can fix this?
var storagedict = {"A"=>1,"B"=>2,"C"=>[]}; var myarray = storagedict.get("C"); myarray.add("D"); System.println(myarray); // Prints: [D] System.println(storagedict); //Prints: {A=>1, B=>2, C=>[D]}, when I really want it to stay: {A=>1, B=>2, C=>[]}.
Thanks!
SirLancelot