How do I use shift inside a loop?
<p>When I run this code:</p>

<pre><code>var a = ['a','b','c'];
var b = ['a','b','c'];

for(i = 0; i &lt;= a.length-1; i++){
    b.shift();
    console.log(b);
}
</code></pre>

<p>I expected this output:</p>

<pre><code>['b','c']
['c']
[]
</code></pre>

<p>But I get this output:</p>

<pre><code>[]
[]
[]
</code></pre>

<p>Why?</p>

<p>And how do I get my expected output? </p>
