See the code below: container = ['localhost:8080', 'aaaaaaaaa', 'history'] for(var i in container) { console.log(container[i]); console.log(container.slice(0,i+1)); } The Firebug output is below: localhost:8080 ["localhost:8080"] aaaaaaaaa ["localhost:8080", "aaaaaaaaa", "history"] history ["localhost:8080", "aaaaaaaaa", "history"] Notice the problem there? When i == 1, why slice() output is not: ["localhost:8080", "aaaaaaaaa"] ?????? I cannot explain why this is happening [...]
