Answers for "delete by index in array js"

36

javascript remove from array by index

//Remove specific value by index
array.splice(index, 1);
Posted by: Guest on May-06-2020
0

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]   */
Posted by: Guest on November-20-2020

Code answers related to "delete by index in array js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language