import { fn } from "https://deno.land/x/ddc_vim@v4.0.2/deps.ts";
const { copy } = fn;
Make a copy of {expr}. For Numbers and Strings this isn't
different from using {expr} directly.
When {expr} is a List
a shallow copy is created. This means
that the original List
can be changed without changing the
copy, and vice versa. But the items are identical, thus
changing an item changes the contents of both Lists
.
A Dictionary
is copied in a similar way as a List
.
Also see deepcopy()
.
Can also be used as a method
:
mylist->copy()