We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Rotates values in array. 🏃 📼 📦 🌔
Alternatives: default, update.
array.rotate(x, n); // x: an array // n: rotate amount (-ve: left, +ve: right)
const array = require('extra-array'); var x = [1, 2, 3, 4]; array.rotate(x, 1); // [ 2, 3, 4, 1 ] array.rotate(x, 2); // [ 3, 4, 1, 2 ] array.rotate(x, -1); // [ 4, 1, 2, 3 ]
There was an error while loading. Please reload this page.