Trying to understand Array.splice().
deleteCount: An integer indicating the number of old array elements to remove.
Ok. Seems straightforward. I want to remove the last 4 objects in the array. I hope that's the same as elements?
arr.splice(<start>, deleteCount<how-many-to-remove>):
// {0 - 8} is an example of object position
let obArr = [{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}]
// Start from the last and remove four:
obArr.splice(-1, 4)
console.log(obArr) // not expected.
console.log(obArr) // expected: [{0}, {1}, {2}, {3}]
-1 won't work in slice?-1means the "last" as indexOf?obArrso it's not what OP wants.