Rotates values in array.
[:package:](https://www.npmjs.com/package/@extra-array/rotate-update)
[:smiley_cat:](https://github.com/orgs/nodef/packages?repo_name=extra-array)
[:running:](https://npm.runkit.com/@extra-array/rotate-update)
[:vhs:](https://asciinema.org/a/332120)
[:moon:](https://www.npmjs.com/package/@extra-array/rotate-update.min)
[:scroll:](https://unpkg.com/@extra-array/rotate-update/)
[:newspaper:](https://nodef.github.io/extra-array/)
[:blue_book:](https://github.com/nodef/extra-array/wiki/)

> Alternatives: [rotate], [rotate$].<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.rotate$(x, [n]);
// x: an array (updated)
// n: rotate amount (+ve: left, -ve: right)
// → x
```

```javascript
const array = require("extra-array");

var x = [1, 2, 3, 4];
array.rotate$(x, 1);
// [ 2, 3, 4, 1 ]

x;
// [ 2, 3, 4, 1 ]

var x = [1, 2, 3, 4];
array.rotate$(x, 2);
// [ 3, 4, 1, 2 ]

var x = [1, 2, 3, 4];
array.rotate$(x, -1);
// [ 4, 1, 2, 3 ]
```

<br>
<br>


## References

- [Collections.rotate: Java](https://docs.oracle.com/javase/7/docs/api/java/util/Collections.html#rotate(java.util.List,%20int))
- [arr-rotate: @kevva](https://www.npmjs.com/package/arr-rotate)

[rotate]: https://github.com/nodef/extra-array/wiki/rotate
[rotate$]: https://github.com/nodef/extra-array/wiki/rotate$
[repeat]: https://github.com/nodef/extra-array/wiki/repeat
[cycle]: https://github.com/nodef/extra-array/wiki/cycle
[reverse]: https://github.com/nodef/extra-array/wiki/reverse
