javscript remove from arra code example
Example 1: remove a particular element from array
var colors = ["red","blue","car","green"];
var carIndex = colors.indexOf("car");
colors.splice(carIndex, 1);
Example 2: remove an element from array
var colors = ["red", "blue", "car","green"];
colors = colors.filter(data => data != "car");
colors = colors.filter(function(data) { return data != "car"});
Example 3: js remove element from array
let arrDeletedItems = array.splice(start[, deleteCount[, item1[, item2[, ...]]]])
Example 4: remove element from array javascript
let values = [1,2,3,4,5,7,8,9,10]
values.length = 5
Example 5: remove element from array js
var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.pop();
Example 6: remove element from array
array.remove(number);
array.remove(number);