Skip to content

Instantly share code, notes, and snippets.

@jyotiarora2610
Created July 17, 2018 01:53
Show Gist options
  • Save jyotiarora2610/2c47f6b856332d07342c8c2697b6839e to your computer and use it in GitHub Desktop.
Save jyotiarora2610/2c47f6b856332d07342c8c2697b6839e to your computer and use it in GitHub Desktop.
function shiftArr (n, rotation, arr) {
for (let i= 0; i < rotation ; i++) {
let sElement = arr.shift()
arr.push(sElement)
}
}
shiftArr(5, 4, [1, 2, 3, 4, 5])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment