src/vs/base/common/arrays.ts/splice
export function splice<T>(array: T[], start: number, deleteCount: number, newItems: T[]): T[] {
	const index = getActualStartIndex(array, start);
	const result = array.splice(index, deleteCount);
	insertInto(array, index, newItems);
	return result;
}