【js】数组 - 翻转数组

40 阅读1分钟

分析

1 声明一个新数组newArr

2 把旧数组索引号第4个取过来(arr.length - 1) 给新数组索引号第0个元素(newArr.length)

3 递减方式 i-- image.png

函数翻转数组

image.png