Pętla JS do tyłu
var arr = [1, 2, 3, 4, 5];
for (var i = arr.length - 1; i >= 0; i--) {
console.log(arr[i]);
}
Friendly Hawk
var arr = [1, 2, 3, 4, 5];
for (var i = arr.length - 1; i >= 0; i--) {
console.log(arr[i]);
}
var arr = [1, 2, 3, 4, 5];
for (var i = arr.length - 1; i >= 0; i--) {
arr[i]
}
let reverseArray = Arr=>{
let pushed =[];
for(let i = Arr.length -1; i >= 0; i--){
pushed.push(Arr[i]);
}
return pushed
}
const sentence = ['sense.','make', 'all', 'will', 'This'];
console.log(reverseArray(sentence))
// Should print ['This', 'will', 'all', 'make', 'sense.'];