Write a function named rotateArray
that receives 2 parameters:
items
n
The 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
=