js remove from array by value

JavaScript
var colors = ["red","blue","car","green"];
var carIndex = colors.indexOf("car");//get  "car" index
//remove car from the colors array
colors.splice(carIndex, 1); // colors = ["red","blue","green"]const index = array.indexOf(item);
if (index !== -1) array.splice(index, 1);const array = [2, 5, 9];

console.log(array);

const index = array.indexOf(5);
if (index > -1) {
  array.splice(index, 1);
}

// array = [2, 9]
console.log(array); var arr = ['bill', 'is', 'not', 'lame'];

arr.splice(output_items.indexOf('not'), 1);

console.log(arr) //returns ['bill', 'is', 'lame']var index = array.indexOf(item);
if (index !== -1) array.splice(index, 1);var array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];
var filtered = array.filter(function(value, index, arr){
    return value > 5;
});
//filtered => [6, 7, 8, 9]
//array => [1, 2, 3, 4, 5, 6, 7, 8, 9, 0]
Source

Also in JavaScript: