What is the difference between copy() and deepcopy()?

None of the operations above are copies, they are assignments. For understanding the difference between copy and deepcopy, consider

A1 = [[1]]
A2 = copy(A1)
A1[1] === A2[1]                 # true
A3 = deepcopy(A1)
A1[1] === A3[1]                 # false
5 Likes