function reverseArrayItems(arr) {
for (let i = arr.length - 1; i >= 0; i--) {
console.log(`${arr[i]}`);
}
};
const words = ['reversed', 'be', 'should', 'order', 'The'];
console.log(reverseArrayItems(words))
// Expected output: ['The', 'order', 'should', 'be', 'reversed'];
const numbers = [10, 20, 30, 40, 50];
console.log(reverseArrayItems(numbers));
// Expected output: 50, 40, 30, 20, 10
I keep getting an undefined at the end. Can someone help me out with this small problem? Apologies for the beginner question.