Potong stringTarget

// Truncate a Stringtarget
target;
target;
// You are given two arrays and an index.
// Copy each element of the first array into the second array, in order.
// Begin inserting elements at index n of the second array.
// Return the resulting array. The input arrays should remain the same after the function runs.

function frankenSplice(arr1, arr2, n) {
	const result = [...arr2];

	result.splice(n, 0, ...arr1);

	return result;
}

frankenSplice([1, 2, 3], [4, 5, 6], 1);
YosKa