17. Rotate Array
Lesson 18 of 31 in Coddy's 30 Days of Logic Building in Javascript course.
Challenge
MediumWrite a function to rotate elements in an array to the right by a given number of steps.
- Input:
<strong>[1, 2, 3, 4, 5]</strong>,<strong>2</strong> - Output:
<strong>[4, 5, 1, 2, 3]</strong>
Try it yourself
function rotateArray(steps, arr) {
// write your code below
}All lessons in 30 Days of Logic Building in Javascript
1Introduction
What is here for you?