Skip to main content
Module

x/denops_std/function/mod.ts>copy

📚 Standard module for denops.vim
Go to Latest
function copy
import { copy } from "https://deno.land/x/denops_std@v6.4.0/function/mod.ts";

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()

Parameters

denops: Denops
expr: unknown

Returns

Promise<unknown>