how to remove a string from array js 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: how to remove element from array in javascript
var colors = ["red","blue","car","green"];
var carIndex = colors.indexOf("car");
colors.splice(carIndex, 1);
Example 3: how to delete an element from an array
var array = [123, "yee", true];
array.pop(index);
Example 4: remove a value to an array of javascript
var data = [1, 2, 3];
data.splice(1, 1);
data.pop();