Answers for "delete a 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
2

pop up element from specific index in array

let items = ['a', 'b', 'c', 'd'];
let index = items.indexOf('a')
let numberOfElementToRemove = 1;
if (index !== -1) { items.splice(index,numberOfElementToRemove)}
Posted by: Guest on June-13-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language