Skip to main content
Module

x/collections/vector.ts>Vector#set

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.set
import { Vector } from "https://deno.land/x/collections@0.12.1/vector.ts";

Sets the value at the given index, then returns the value. If the value is negative, it will be subtracted from the end. The index 0 would set the first value in the vector. The index -1 would set the last value in the vector. If the absolute index value is greater than the length, the size will be increased to match before setting the value.

Parameters

index: number
value: T | undefined