Write a function named moveItems
that receives 2 parameters:
numbers
numbers
Array. Let's call this param moveInstructions
. Each items inside moveInstructions
has 2 properties:fromIndex
: the index of the item we want to movetoIndex
: the new index we'll be moving the item toThe function should return the numbers
Array after applying all the move instructions, in order.
numbers
=moveInstructions
=numbers
=moveInstructions
=