await pool.query(
`INSERT INTO public.orders(id, status, type, time) \
SELECT unnest(array[%1]), unnest(array[%2]), unnest(array[%3]), unnest(array[%4])`,
[
data.map(item => item.id),
data.map(item => item.status),
data.map(item => item.type),
data.map(item => item.time),
]
)
let today = [yearToday, monthToday, dayToday].map(s => s.padStart(2, '0')).join('-')
function shuffle(arr) {
for (let i = arr.length - 1; i > 0; --i) {
const pos = Math.floor(Math.random() * (i + 1));
const t = arr[pos];
arr[pos] = arr[i];
arr[i] = t;
}
return arr;
}
const newArr = shuffle(imagesData.slice()); // новый перемешанный, imagesData не поменялось
const newArr2 = shuffle(imagesData); // перемешали imagesData, присвоили в newArr2
globalFunc.[[Scope]] = window;