Javascript Remove an Element from an Array at an Index

Sometimes we need to delete an item from an array.

In this case, you should follow these steps.

[js]
var array = [2, 5, 4, 7, 9];
var index = array.indexOf(5);

array.splice(index, 1);
[/js]

[html]
Result: [2, 4, 7, 9]
[/html]