const array = [];
for (let i = 0; i < 10; i++) {array.push(Math.floor(Math.random() * 101) - 50);}
array.sort((a, b) => b - a);
console.log(array); // Отсортированный массив по убыванию
const array = [];
for (let i = 0; i < 10; i++) {
array.push(Math.floor(Math.random() * 101) - 50);
}
array.sort((a, b) => b - a);
console.log(array); // Отсортированный массив по убыванию