how to remove item from array javascript

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"]var list = ["bar", "baz", "foo", "qux"];
list.shift()//["baz", "foo", "qux"]var array = ["Item", "Item", "Delete me!", "Item"]

array.splice(2,1) // array is now ["Item","Item","Item"]var ar = ['zero', 'one', 'two', 'three'];
ar.shift(); // returns "zero"
console.log( ar ); // ["one", "two", "three"]// remove element at certain index without changing original
let arr = [0,1,2,3,4,5]
let newArr = [...arr]
newArr.splice(1,1)//remove 1 element from index 1
console.log(arr) // [0,1,2,3,4,5]
console.log(newArr)// [0,2,3,4,5]var data = [1, 2, 3];

// remove a specific value
// splice(starting index, how many values to remove);
data = data.splice(1, 1);
// data = [1, 3];

// remove last element
data = data.pop();
// data = [1, 2];
Source

Also in JavaScript: