For example, you have an array
var arr = ["A", "B", "C"];
and you need to get something like this:
var arr = ["A", "C"];
You can simply use this:
arr.splice( 1, arr.length - 2 );
var arr = ["A", "B", "C"]; arr.splice(1, arr.length - 2); console.log(arr);
Splice takes at least 2 variables (this goes only if you use splice to remove items), the first being the position of the string at which you want to start removing items, and the second the number of items you actually want to remove.
After the first element of the array, remove the next X items with X being the length of the array minus the first and the last element (this is why you have the "-2").