1const index = array.indexOf(item);
2if (index > -1) {
3 array.splice(index, 1);
4}
1var data = [1, 2, 3];
2
3// remove a specific value
4// splice(starting index, how many values to remove);
5data.splice(1, 1);
6// data = [1, 3];
7
8// remove last element
9data.pop();
10// data = [1, 2];