At the start:
x is [A, B, C, D] (the nil is not part of the array, it just tells initWithObjects: where the end of the list of objects is).
y is [E, F, G, H, I, J]
[x addObjectsFromArray:y]; // only works if x is a mutable array
x is [A, B, C, D, E, F, G, H, I, J]
y is [E, F, G, H, I, J]
[y removeAllObjects]; // only works if y is a mutable array.
x is [A, B, C, D, E, F, G, H, I, J]
y is []
y = [x mutableCopy];
x is [A, B, C, D, E, F, G, H, I, J]
y is [A, B, C, D, E, F, G, H, I, J]
Note that the previous version of y that you emptied may have leaked because you overwrote the pointer with a pointer to a new mutable copy of x. You should have done:
[y release];
y = [x mutableCopy];
Or if you obtained y by using +arrayWithObjects: instead of +alloc followed by -initWithObjects: simply
y = [x mutableCopy]; // release not necessary because you didn't own y (you do now though).