1var colors = ["red","blue","car","green"];
2var carIndex = colors.indexOf("car");//get "car" index
3//remove car from the colors array
4colors.splice(carIndex, 1); // colors = ["red","blue","green"]
1let originalArray = [1, 2, 3, 4, 5];
2
3let filteredArray = originalArray.filter((value, index) => index !== 2);