🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
## prototype.reverse + [link](./prototype-reverse "Link to this entry.") + [source](https://github.com/lodash/lodash/blob/4.5.0正式版/lodash.src.js#L6405 "View in source.") + [npm](https://www.npmjs.com/package/lodash.prototype.reverse "See the npm package.") ``` _.prototype.reverse() ``` 反转数组,第一个元素移动到最后一位,第二个元素移动到倒数第二,类似这样。 **注意:** 这个方法会改变数组,根据 [`Array#reverse`](https://mdn.io/Array/reverse) ### 返回值 (Array) 返回原数组 ### 示例 ``` var array = [1, 2, 3]; _.reverse(array); // => [3, 2, 1] console.log(array); // => [3, 2, 1] ```