JavaScript: Array.shift