Content of the page

How to remove specific element from JavaScript array?

Content of the article

Firstly find the index of the element you want to remove:

Note: browser support for indexOf is limited, it is not supported in IE7-8.

Then remove element using its index and function 'splice':

The second parameter of splice is the number of elements to remove.

Note: splice modifies the array in place and returns a new array containing the elements that have been removed.