how to get rid of element in array js 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: removing first item array js
var list = ["bar", "baz", "foo", "qux"];
list.shift()//["baz", "foo", "qux"]