Created
July 17, 2018 01:53
-
-
Save jyotiarora2610/2c47f6b856332d07342c8c2697b6839e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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