delete elemets from original array in javascript code example
Example 1: how to take an element out of an array in javascript
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];
Example 2: java script removing first three indexes
var indexToRemove = 0;
var numberToRemove = 1;
arr.splice(indexToRemove, numberToRemove);