Мое решение
let numbers = [1, 3, 5, 7, 9, 11];
for (i = 0; i < numbers.length/2; i ++) {
let k = numbers[i];
numbers[i] = numbers[numbers.length-1-i];
numbers[numbers.length-1-i] = k;
}
console.log(numbers)
Мое решение
let numbers = [1, 3, 5, 7, 9, 11];
for (i = 0; i < numbers.length/2; i ++) {
let k = numbers[i];
numbers[i] = numbers[numbers.length-1-i];
numbers[numbers.length-1-i] = k;
}
console.log(numbers)
let numbers = [1, 3, 5, 7, 9, 11];
numbers.reverse()
let numbers = [1, 3, 5, 7, 9, 11];
function reverse(array) {
let arrayReverse = [];
for (i = 0; i < array.length; i++) {
arrayReverse[i] = numbers[(numbers.length - 1) - i];
}
return arrayReverse;
};
numbers = reverse(numbers);
numbers = numbers.reverse()
И всё. Первая решенная задачка продвинутого уровня без помощи форумчан