The splice()method can be used to remove elements from an array. In this example, we remove the first 3 from the array.
var values = [1, 2, 3, 4, 5, 3];
var i = values.indexOf(3);
if (i >= 0) {
values.splice(i, 1);
}
// [1, 2, 4, 5, 3]
The splice() method can also be used to add elemen...