N
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"]
N
let arrDeletedItems = array.splice(start[, deleteCount[, item1[, item2[, ...]]]])
N
const cars = ['farrari', 'Ice Cream'/* It is not an car */, 'tata', 'BMW']
//to remove a specific element
cars.splice(colors.indexOf('Ice Cream'), 1);
//to remove the last element
cars.pop();
N
var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.pop();
// Removes the last element ("Mango") from fruits