remove the index of an array code example
Example 1: js remove item array
let originalArray = [1, 2, 3, 4, 5];
let filteredArray = originalArray.filter((value, index) => index !== 2);
Example 2: delete an item from array javascript
let items = [12, 548 ,'a' , 2 , 5478 , 'foo' , 8852, , 'Doe' ,2154 , 119 ];
items.length; // return 11
items.splice(3,1) ;
items.length; // return 10
/* items will be equal to [12, 548, "a", 5478, "foo", 8852, undefined × 1, "Doe", 2154, 119] */