Version: v0.5.1 - Beta.  We welcome contributors & feedback.  THanks!

List.copy

copy()

Description

Copy the List into a new List.

let list1 = [1, 2, 3];
let list2 = list1.copy();

list1[0] = 11;
list2[0] = 22;

print(list1);  //= [11, 2, 3]
print(list2);  //= [22, 2, 3]