Blog › JavaScript · Published 2026-11-26

How to remove a specific item from an array in JavaScript

Two common ways:

Change the original array

const i = arr.indexOf("b");
if (i !== -1) arr.splice(i, 1);

splice(start, count) removes items in place.

Make a new array

const next = arr.filter(x => x !== "b");

filter keeps the original unchanged and removes every match. Use it when working with React state.

Official sources

Need help with your project?
We build websites, systems and automation. Start your project WhatsApp

All articles