Why in JavaScript parent variable takes the value of child variable?
<p>Help me please with next problem. </p>

<pre><code>var a = _b; //_b and _c is arguments. _b is array of objects (length = 1), _c is integer value
if (a.length != 0)
{
   $.each(a,function(k,v){
     if (v.c!= _c)
       a.splice(k,1);//here a becomes empty, but _b becomes empty too. i don't know why.
   }); 
   if (a.length != 0){
      _b = a;
   }
}
</code></pre>

<p>what am I doing wrong?</p>
