-
Notifications
You must be signed in to change notification settings - Fork 1
Clone
ricardoboss edited this page Sep 13, 2023
·
1 revision
clone
can be used to create a copy of a value.
clone(any subject)
-
subject
is the value to be cloned.
-
clone
is a deep copy, meaning that all nested values are also cloned (inlist
s andmap
s)
list l = [3, 2]
println(l) // [3, 2]
doAdd(l, 1)
println(l) // [3, 2, 1]
list l2 = clone(l)
println(l2) // [3, 2, 1]
doAdd(l, 0)
println(l) // [3, 2, 1, 0]
println(l2) // [3, 2, 1]
© 2023 Ricardo Boss • Licensed under MIT • Want to update this page? Edit it on GitHub and submit a pull request!