I was wondering what was the most efficient way to rotate a JavaScript array.
I came up with this solution, where a positive n rotates the array to the
n
Using for loop. Here are the steps
function rotateLeft(arr, rotations) { let len = arr.length; for(let i=0; i ", output);