Skip to content

Instantly share code, notes, and snippets.

@Lokua
Created September 30, 2018 03:44
Show Gist options
  • Save Lokua/41ebea3696e519d67ec2f0191defc595 to your computer and use it in GitHub Desktop.
Save Lokua/41ebea3696e519d67ec2f0191defc595 to your computer and use it in GitHub Desktop.
rotate.js
const rotate = (array, n) => [
...array.slice(array.length - n),
...array.slice(0, array.length - n),
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment