array remove in javascript code example
Example 1: javascript array remove
let yourArray = ["aaa", "bbb", "ccc", "ddd"];
yourArray.pop();
let yourArray = ["aaa", "bbb", "ccc", "ddd"];
yourArray.shift();
Example 2: delete from array javascript
var arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];var removed = arr.splice(2,2);
Example 3: how can i remove a specific item from an array
const items = ['a', 'b', 'c', 'd', 'e', 'f']
const i = 2
const filteredItems = items.slice(0, i).concat(items.slice(i + 1, items.length))