我需要将任意数字添加到随机数组到预设位置,并在他之后移动元素。我刚刚为随机数组编写了代码如何继续?
var CreateArray = (...lengths) => lengths.map(length => (
Array.from({
length
}, () => Math.floor(Math.random() * 3000000))
));
var randomarrays = (arrs) => {
arrs.forEach(arr => {
randomarray(arr);
});
};