@extra-array/reverse-update
Version:
Reverses the array.
53 lines (39 loc) • 1.64 kB
Markdown
Reverses the array.
[:package:](https://www.npmjs.com/package/@extra-array/reverse-update)
[:smiley_cat:](https://github.com/orgs/nodef/packages?repo_name=extra-array)
[:running:](https://npm.runkit.com/@extra-array/reverse-update)
[:vhs:](undefined)
[:moon:](https://www.npmjs.com/package/@extra-array/reverse-update.min)
[:scroll:](https://unpkg.com/@extra-array/reverse-update/)
[:newspaper:](https://nodef.github.io/extra-array/)
[:blue_book:](https://github.com/nodef/extra-array/wiki/)
> Alternatives: [reverse], [reverse$].<br>
> Similar: [repeat], [cycle], [rotate], [reverse].
> This is part of package [extra-array].
[extra-array]: https://www.npmjs.com/package/extra-array
<br>
```javascript
array.reverse$(x);
// x: an array (updated)
// → x
```
```javascript
const array = require("extra-array");
var x = [1, 2, 3, 4];
array.reverse$(x);
// [ 4, 3, 2, 1 ]
x;
// [ 4, 3, 2, 1 ]
```
<br>
<br>
## References
- [Array.prototype.reverse: MDN web docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse)
- [Collections.reverse: Java](https://docs.oracle.com/javase/7/docs/api/java/util/Collections.html#reverse(java.util.List))
- [_.reverse: lodash](https://lodash.com/docs/4.17.15#reverse)
- [immutable-array-prototype: @azu](https://github.com/azu/immutable-array-prototype)
[reverse]: https://github.com/nodef/extra-array/wiki/reverse
[reverse$]: https://github.com/nodef/extra-array/wiki/reverse$
[repeat]: https://github.com/nodef/extra-array/wiki/repeat
[cycle]: https://github.com/nodef/extra-array/wiki/cycle
[rotate]: https://github.com/nodef/extra-array/wiki/rotate