Skip to main content
Module

x/collections/vector.ts>Vector#splice

Collection data structures that are not standard built-in objects in JavaScript. This includes a vector (double-ended queue), binary heap (priority queue), binary search tree, and a red black tree.
Latest
method Vector.prototype.splice
import { Vector } from "https://deno.land/x/collections@0.12.1/vector.ts";

Changes the contents of an array in place by removing or replacing existing elements or inserting new values. Then returns an Vector of the values that were removed. Returns a shallow copy of a portion of the vector into a new vector. The start represents the index of value you may insert values before or delete values starting from. The deleteCount is the number of values you would like to delete from the vector. The deleteCount would default to the number of values between the index and the end of the vector. If the start value is negative, it will be subtracted from the end of the vector. If the deleteCount is less than 0, no values will be deleted. If any insert values are specified, they will be inserted before the start index.

Parameters

start: number
optional
deleteCount: number

Parameters

start: number
deleteCount: number
...insertValues: (T | undefined)[]