I have an array of numbers which i want to use as an index position in the splice method, an array with 10 undefined values that serve as empty slots (index positions), and a years array.
const positionsOfYears = [2, 5, 8];
const emptyArray [undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined,];
const years = [1992, 1999, 2000];
My desired output is this
emptyArray = [undefined, undefined, 1992, undefined, undefined, 1999, undefined, undefined, 2000, undefined]
Thank you