function removeFastWithoutKeepingOrder(array, index) {
    const last = array.length - 1;
    if (index < last) {
        array[index] = array[last];
    }
    array.pop();
}
Remove the element at `index` by replacing it with the last element. This is faster than `splice`
but changes the order of the array