Lets start with one example here.
Suppose inside Script region, we have an array as shown here.
var array = [4, 8, 12, 16, 20];
Now, we wants to remove 12 from above array.
The best way is that we can make use of array.indexOf() method.
By using indexOf method, we can find the index of an element.
Here the index of element 12 is 2.
And then we have to make use of array.splice()
startIndex is, Index at which to start changing the array (with origin 0).
deleteCount is, An integer indicating the number of old array elements to be removed.
In the above case, splice can be used as shown here.
Inside array, from index 2, remove one element which is 12.