Skip to content

Instantly share code, notes, and snippets.

@PatrickEifler
Last active September 30, 2016 17:53
Show Gist options
  • Save PatrickEifler/223f4d61fe23e087d69bf9f22bb8d6b6 to your computer and use it in GitHub Desktop.
Save PatrickEifler/223f4d61fe23e087d69bf9f22bb8d6b6 to your computer and use it in GitHub Desktop.
let curr = 0;
const circle (arr, dir) => {
curr = (curr + arr.length + (dir ? -1 : 1)) % arr.length;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment