javascript remove first 10 elements from array code example
Example 1: javascript remove first element from array
var arr = [1, 2, 3, 4];
var theRemovedElement = arr.shift();
console.log(arr);
Example 2: remove a particular element from array
var colors = ["red","blue","car","green"];
var carIndex = colors.indexOf("car");
colors.splice(carIndex, 1);
Example 3: exclude vales from array in js
var array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];
var filtered = array.filter(function(value, index, arr){
return value > 5;
});