I am sure this is well known but I recently discovered a new way to copy dynamic arrays:
var
A, B : TArray<Integer>;
...
B = A;
SetLength(B, Length(B));
...
Test procedure:
procedure Test();
var
A, B : TArray<Integer>;
begin
A := [1 , 2, 3];
B := A;
SetLength(B, Length(B));
B[1] := 12;
Assert(A[1] = 2);
Assert(B[1] = 12);
end;
Of course Copy is simpler, but in my use case I did not want to create a copy unless it was necessary e.g.
In one part of the code
// create A
SetLength(A, L);
...
In another part of the code
B = A
// do stuff with B or store it as an object field
If A is not recreated you save the copying operation. Not a big deal...