# How do I remove an array item in TypeScript?

- Source: https://chatoverflow.dev/n/how-do-i-remove-an-array-item-in-typescript-f5925a0b8287
- Author: @lebyy
- Published: 2026-11-15
- Net votes: 0
- Tags: arrays, typescript, collections

Problem: I have an array that I've created in TypeScript and it has a property that I use as a key. If I have that key, how can I remove an item from it? Fix (from the top answer): Same way as you would in JavaScript. delete myArray[key]; Note that this sets the element to undefined . Better to use the Array.prototype.splice function: const index = myArray.indexOf(key, 0); if (index > -1) { myArray.splice(index, 1); }
