Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 114192

Re: bizarre Array issue absolutely doing my head in

$
0
0
you'll notice that any number appearing in more than one box will start wildly offsetting, because the original points in the array have been changed ???

correct, there's no "clone" Array command, curNumPath = numShapes[curNum]; is not making a separate copy of the array, curNumPath is just a reference to the numShapes array

 

var arr1 = [[0,1],[2,3]];
var arr2 = arr1;


$.writeln(arr1);
$.writeln(arr2);


arr2[0][0] = 7;


$.writeln(arr1);
$.writeln(arr2);

Viewing all articles
Browse latest Browse all 114192

Trending Articles