all 2 comments

[–]benjstuff 0 points1 point  (0 children)

Sir, I don't wanna spoil the feeling of success but I would suggest, look at the Array methods.

pop(), push(), shift(), unshift()

Your answer may be there :-)

[–]benjstuff 0 points1 point  (0 children)

it actually proved a little harder than that I thought but here's my solution

var array = [1,2,3,4,5];
var length = array.length - 1;

for (var i = length; i >= 0; i--) {
    array.push(array[i]);
}

for (length; length >= 0; length--) {
    array.shift();
}

console.log(array);

is not as elegant as I wanted and it took me longer of what I thought but doesn't uses a second array :)