You can use the indexOf method like this:

var index = array.indexOf(item);
if (index !== -1) {
  array.splice(index, 1);
}

Note: You'll need to shim it for IE8 and below

var array = [1,2,3,4]
var item = 3

var index = array.indexOf(item);
array.splice(index, 1);

console.log(array)

Answer from SLaks on Stack Overflow
๐ŸŒ
Reddit
reddit.com โ€บ r/learnprogramming โ€บ why is removing a specific element from an array so needlessly complicated in javascript?
Why is removing a specific element from an array so ...
January 17, 2023 -

I'm just looking for something along the lines of:

array.remove("element")

Upon Googling for solutions so far I've found

Remove an element at any index with splice

Remove an element from an array with a for loop and push

Remove an element at any position of an array with slice and concat

There's more but I'm assuming you get the point. Why is this seemingly simple task so ridiculously complicated with Javascript?

Did nobody think to include a ".remove()" method when they were first developing Javascript? Is there a quirk of the language that makes it impossible? What is the reason for this?

Discussions

How do I remove from an array those elements that exists in another array?
All you need is a simple filter function, or you could just manually loop over the array. var filteredPeople = people.filter(function(element) { return peopleToRemove.indexOf(element) === -1; }); More on reddit.com
๐ŸŒ r/javascript
11
8
September 10, 2014
Why is removing a specific element from an array so needlessly complicated in Javascript?
You could use the .filter method. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter Use it like this: const newArray = array.filter(element => element > 6) The 'element > 6' is just a placeholder example. If your array was a series of numbers, it would only return numbers that are greater than six. If you wanted it to remove a certain word from an array of words you could switch that conditional statement out with "element !== 'word' " 'newArray' will be your array without the value you're trying to remove. 'Array' represents the current array with the value you're trying to remove More on reddit.com
๐ŸŒ r/learnprogramming
9
0
January 17, 2023
Remove item from this.state.users
it is really annoying because every god damn thing in JavaScript is destructive and you really don't want to use destructive methods on your state What I did was have a function to remove that filtered the list based on index, and setState to that list (ES6 syntax): removeItem(index) { this.setState({ items: this.state.items.filter((x,i) => i != index }) }); } and then when you're generating your items to render, let rendered = this.state.items.map( (x, i) => ); More on reddit.com
๐ŸŒ r/reactjs
7
2
August 11, 2014
๐ŸŒ
MDN Web Docs
developer.mozilla.org โ€บ en-US โ€บ docs โ€บ Web โ€บ JavaScript โ€บ Reference โ€บ Global_Objects โ€บ Array โ€บ splice
Array.prototype.splice() - JavaScript | MDN
An integer indicating the number of elements in the array to remove from start. If deleteCount is omitted, or if its value is greater than or equal to the number of elements after the position specified by start, then all the elements from start to the end of the array will be deleted.
๐ŸŒ
Sentry
sentry.io โ€บ sentry answers โ€บ javascript โ€บ how can i remove a specific item from an array?
How Can I Remove a Specific Item from an Array? | Sentry
There are a few methods you can use to remove specific elements from an array in JavaScript. If the pop() or shift() methods wonโ€™t work for your purposes, you can select a method depending on whether youโ€™ll identify the item by its value ...
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ javascript โ€บ remove-array-element-based-on-object-property-in-javascript
Remove Array Element Based on Object Property in JavaScript - GeeksforGeeks
July 23, 2025 - The code removes the object with id: 2 from the array using a loop and splice, adjusting the index with i-- to avoid skipping elements. The reduce() method in JavaScript processes an array to produce a single output by applying a callback function ...
๐ŸŒ
freeCodeCamp
freecodecamp.org โ€บ news โ€บ how-to-remove-an-element-from-a-javascript-array-removing-a-specific-item-in-js
How to Remove an Element from a JavaScript Array โ€“ Removing a Specific Item in JS
August 31, 2022 - The two arrays are concatenated together with concat to form an array that is similar to the starting one, but without a particular element. If you want to remove an element with a certain value, you can use Array.prototype.filter().
๐ŸŒ
W3Schools
w3schools.com โ€บ js โ€บ js_array_methods.asp
W3Schools.com
The slice() method does not remove any elements from the source array.
Find elsewhere
๐ŸŒ
Scaler
scaler.com โ€บ home โ€บ topics โ€บ remove elements from a javascript array
Remove Elements from a JavaScript Array - Scaler Topics
March 12, 2024 - The predicate determines which elements should be removed based on the return value (true for removal). ... Let's use Lodash to remove all even numbers from an array of integers.
๐ŸŒ
DEV Community
dev.to โ€บ jsdevspace โ€บ 9-ways-to-remove-elements-from-arrays-in-javascript-4be6
9 Ways to Remove Elements from Arrays in JavaScript - DEV Community
August 6, 2024 - Here are five common ways to remove elements from arrays in JavaScript: The splice(start, deleteCount, item1ToAdd, item2ToAdd, ...) method changes the contents of an array by removing or replacing existing elements and/or adding new elements ...
๐ŸŒ
CoreUI
coreui.io โ€บ answers โ€บ how-to-remove-a-specific-item-from-an-array-in-javascript
How to remove a specific item from an array in JavaScript ยท CoreUI
September 18, 2025 - Use splice() with indexOf() to efficiently remove a specific element from a JavaScript array by value or index.
๐ŸŒ
Fjolt
fjolt.com โ€บ article โ€บ javascript-how-to-delete-array-item-at-index
Deleting an Item in an Array at a Specific Index
First, we get the index of the item we want to delete by value, using indexOf. Then, we use that number to delete the array item. Hereโ€™s an example. We want to delete the item ravioli from our array below.
๐ŸŒ
Codedamn
codedamn.com โ€บ news โ€บ javascript
How to remove element from an array in JavaScript
June 6, 2023 - The begin parameter indicates the starting index for the new array, and the optional end parameter specifies the end index (not included) for the new array. If end is not provided, the new array will include all elements from begin to the end of the original array. Let's look at an example of using Array.slice() to remove elements from an array.
๐ŸŒ
Medium
zaferayan.medium.com โ€บ how-to-remove-a-specified-item-from-the-object-array-in-javascript-2f480beb2ef7
How to remove a specified item from the object array in JavaScript? | by Zafer Ayan | Medium
March 2, 2022 - In JavaScript, there is no obvious method for removing elements from an array. There is a pop() function that exists but it only removes items from the end of an array. The old but gold splice method can remove items from the specified index.
๐ŸŒ
Ultimate Courses
ultimatecourses.com โ€บ blog โ€บ remove-specific-item-from-array-javascript
Removing Items from an Array in JavaScript - Ultimate Courses
March 12, 2020 - In this example, we are removing items from the initial array by returning a new array of just the items we do want, using drinks[i] allows us to look at and compare the array elementโ€™s value (such as 'Coffee' as a String in this case):
๐ŸŒ
DEV Community
dev.to โ€บ pradeepovig โ€บ javascript-remove-a-specific-element-from-an-array-3k1b
Javascript: Remove a specific element from an array - DEV Community
May 9, 2021 - The _.remove() method removes all elements from array that predicate returns truthy for by manipulating the original array in place. From Lodash Docs. _.remove(array, function(n) { return // A boolean expression; }); It returns an array of the ...
๐ŸŒ
Quora
quora.com โ€บ Is-there-a-method-to-remove-an-item-from-a-JavaScript-array-How-do-you-remove-item-from-array-by-value
Is there a method to remove an item from a JavaScript array? How do you remove item from array by value? - Quora
Answer (1 of 3): As others have mentioned. Use the [code ]splice[/code] method of array to remove the item. Alternately, if you prefer functional programming, where you don't actually alter the original array, you can use [code ]filter[/code] ...
๐ŸŒ
Love2Dev
love2dev.com โ€บ blog โ€บ javascript-remove-from-array
9 Ways To Remove ๐Ÿ—‘๏ธ Elements From A JavaScript Array ๐Ÿ“‡[Examples]
JavaScript Array elements can be removed from the end of an array by setting the length property to a value less than the current value.
๐ŸŒ
Bytearcher
bytearcher.com โ€บ articles โ€บ how-to-delete-value-from-array
How to delete a value from an array in JavaScript
NAVIGATION Use splice() to remove arbitrary item Use shift() to remove from beginning Use pop() to remove from end Using delete creates empty spots Remember this This classic question pops up once in
๐ŸŒ
HostingAdvice
hostingadvice.com โ€บ home โ€บ how-to
JavaScript: Remove Element from an Array
March 22, 2023 - This implements the idea of a Last-In-First-Out data structure (LIFO). The push() method will ADD an element to the array and the pop() method will remove one.
๐ŸŒ
CoreUI
coreui.io โ€บ blog โ€บ how-to-remove-element-from-javascript-array
How to Remove Elements from a JavaScript Array ยท CoreUI
February 13, 2025 - By using methods like splice or filter, you can handle different methods of removal gracefully. For instance, if you must remove an element of the array with a specified value, consider filter.