Here is my code:
function fix(arr) {
var x = arr.pop();
var y = arr.splice(0, 1);
arr.unshift(x);
arr.push(y);
return arr;
}
The output gives the array elements in the order I need. It has an extra ] at the end of the array which I can't figure out how to get rid of.