When I run this code:
var a = ['a','b','c'];
var b = ['a','b','c'];
for(i = 0; i <= a.length-1; i++){
b.shift();
console.log(b);
}
I expected this output:
['b','c']
['c']
[]
But I get this output:
[]
[]
[]
Why?
And how do I get my expected output?