import { fn } from "https://deno.land/x/ddc_vim@v4.0.2/deps.ts";
const { add } = fn;
Append the item {expr} to List
or Blob
{object}. Returns
the resulting List
or Blob
. Examples:
:let alist = add([1, 2, 3], item)
:call add(mylist, "woodstock")
Note that when {expr} is a List
it is appended as a single
item. Use extend()
to concatenate Lists
.
When {object} is a Blob
then {expr} must be a number.
Use insert()
to add an item at another position.
Returns 1 if {object} is not a List
or a Blob
.
Can also be used as a method
:
mylist->add(val1)->add(val2)