Write a function named rotateArray that receives 2 parameters:
itemsnThe function should return a new array with the items rotated towards the right, by n positions.
NOTE: a rotation towards the right means that all elements of the array are moved to the next index, except for the last element which is moved to
index=0.
items
=n
=items
=n
=Unlock all functions
The first 10 functions are free. Get lifetime access to all 100 with a one-time payment — no subscription.
Upgrade to Pro