How do I remove a particular element from an array in JavaScript?

Posted by Pooja Joshi | Updated on

How do I remove a particular element from an array in JavaScript?

#1 Solution
Find the index of the array element you want to remove using indexOf, and then remove that index with splice.

#2. Solution

Live Demo


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers