const reverseArray = (words) => {
for (let i = words.length - 1; i >= 0; i--) {
console.log(`${words[i]}`);
}
};
const sentence = ['sense.', 'make', 'all', 'will', 'This'];
console.log(reverseArray(sentence))
// Should print ['This', 'will', 'all', 'make', 'sense.'];
const nums = [1, 2, 3, 4, 5];
console.log(reverseArray(nums));
// Should print 5,4,3,2,1
但它最后总是给我未定义?我知道这是一个菜鸟问题,抱歉。
天涯尽头无女友
鸿蒙传说
芜湖不芜
慕侠2389804
相关分类