Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/dallmo_util_array/app.ts>insert_item

deno module, a collection of array util under dallmo-util
Latest
function insert_item
import { insert_item } from "https://deno.land/x/dallmo_util_array@v1.3.0/app.ts";

insert an item into an array with specific position

Parameters

input_array: any[]
  • the original array
item_index: number
  • in the new array, the index for the new_item
new_item: any
  • the item to insert into the original array

Returns

any[]

a new array with new_item inserted according to item_index