Sometimes, we want to remove an array item in TypeScript.
In this article, we’ll look at how to remove an array item in TypeScript.
How to remove an array item in TypeScript?
To remove an array item in TypeScript, we can use the array splice
method as we do with JavaScript.
For instance, we write:
myArray.splice(index, 1);
to remove the myArray
entry at index
with splice
.
Conclusion
To remove an array item in TypeScript, we can use the array splice
method as we do with JavaScript.