@extra-array/rotate-update.min
npm i @extra-array/rotate-update.min

@extra-array/rotate-update.min

An array is a collection of values, stored contiguously.

by nodef

2.10.19 (see all)License:MITTypeScript:Built-In
npm i @extra-array/rotate-update.min
Readme

Rotates values in array. 📦 😺 🏃‍♂️ 📼 🌔 📜 📰 📘

Alternatives: rotate, rotate$.
Similar: repeat, cycle, rotate, reverse.

This is part of package extra-array.

This is browserified, minified version of @extra-array/rotate-update.
It is exported as global variable array_rotate$.
CDN: unpkg, jsDelivr.


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


References

Downloads/wk

3

GitHub Stars

14

LAST COMMIT

4mos ago

MAINTAINERS

1

CONTRIBUTORS

3

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
2.10.19
latest
4mos ago
No alternatives found
No tutorials found
Add a tutorial