const array = new Array(10).fill().map(() => Math.floor(Math.random() * 21 - 10)); // генерируем массив из 10 случайных чисел от -10 до 10
let product = 1;for (let i = 1; i < array.length; i += 2) {product *= array[i];}
console.log("Массив:", array);console.log("Произведение элементов с нечетными индексами:", product);
const array = new Array(10).fill().map(() => Math.floor(Math.random() * 21 - 10)); // генерируем массив из 10 случайных чисел от -10 до 10
let product = 1;
for (let i = 1; i < array.length; i += 2) {
product *= array[i];
}
console.log("Массив:", array);
console.log("Произведение элементов с нечетными индексами:", product);