remove an index from an array code example
Example 1: javascript remove from array by index
//Remove specific value by index
array.splice(index, 1);
Example 2: 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"});