js remove item array

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"]let originalArray = [1, 2, 3, 4, 5];

let filteredArray = originalArray.filter((value, index) => index !== 2);
Source

Also in JavaScript: