Inserts values at position index, shuffling remaining items further down and returning changed result.
values
index
Does not modify the input array.
const data = [ 1, 2, 3 ]// Inserts 20,30,40 at index 1Arrays.insertAt(data, 1, 20, 30, 40);// Yields: 1, 20, 30, 40, 2, 3 Copy
const data = [ 1, 2, 3 ]// Inserts 20,30,40 at index 1Arrays.insertAt(data, 1, 20, 30, 40);// Yields: 1, 20, 30, 40, 2, 3
Inserts
values
at positionindex
, shuffling remaining items further down and returning changed result.Does not modify the input array.