Answers for "how to remove element using document from javascript array"

36

javascript remove from array by index

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

remove an element from array

var colors = ["red", "blue", "car","green"];

// op1: with direct arrow function
colors = colors.filter(data => data != "car");

// op2: with function return value
colors = colors.filter(function(data) { return data != "car"});
Posted by: Guest on July-16-2020

Code answers related to "how to remove element using document from javascript array"

Code answers related to "Javascript"

Browse Popular Code Answers by Language