Skip to content

removeItem

Removes the first occurrence of a specific item from an array and returns the removed item.

Usage

ts
import { removeItem } from 'rattail'

const arr = [1, 2, 3]
removeItem(arr, 2) // arr becomes [1, 3]

Arguments

ArgTypeDefaults
arrArray
itemany

Return

Type
any