n
of the second array.
Return the resulting array. The input arrays should remain the same after the function runs.
frankenSplice([1, 2, 3], [4, 5], 1)
should return [4, 1, 2, 3, 5]
.
testString: assert.deepEqual(frankenSplice([1, 2, 3], [4, 5], 1), [4, 1, 2, 3, 5]);
- text: frankenSplice([1, 2], ["a", "b"], 1)
should return ["a", 1, 2, "b"]
.
testString: assert.deepEqual(frankenSplice(testArr1, testArr2, 1), ["a", 1, 2, "b"]);
- text: frankenSplice(["claw", "tentacle"], ["head", "shoulders", "knees", "toes"], 2)
should return ["head", "shoulders", "claw", "tentacle", "knees", "toes"]
.
testString: assert.deepEqual(frankenSplice(["claw", "tentacle"], ["head", "shoulders", "knees", "toes"], 2), ["head", "shoulders", "claw", "tentacle", "knees", "toes"]);
- text: All elements from the first array should be added to the second array in their original order.
testString: assert.deepEqual(frankenSplice([1, 2, 3, 4], [], 0), [1, 2, 3, 4]);
- text: The first array should remain the same after the function runs.
testString: frankenSplice(testArr1, testArr2, 1); assert.deepEqual(testArr1, [1, 2]);
- text: The second array should remain the same after the function runs.
testString: frankenSplice(testArr1, testArr2, 1); assert.deepEqual(testArr2, ["a", "b"]);
```