Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/fun/array.ts>deleteAt

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Latest
function deleteAt
import { deleteAt } from "https://deno.land/x/fun@v2.0.0/array.ts";

Delete the value in an array at the given index. If the index is out of bounds then no change is made.

Examples

Example 1

import * as A from "./array.ts";
import { pipe } from "./fn.ts";

const result1 = pipe([1, 2, 3], A.deleteAt(0)); // [2, 3]
const result2 = pipe([1, 2, 3], A.deleteAt(100)); // [1, 2, 3]

Parameters

index: number