Destructuring assignment with function arguments
<pre><code>function foo( [a,b] ) {

    console.log(a);
    console.log(b);
}

foo( [12,34] );
</code></pre>

<p>Prints: </p>

<pre><code>12
34
</code></pre>

<p>Also here:</p>

<pre><code> var { a:x, b:y } = { a:7, b:8 };
 console.log(x); // prints: 7
 console.log(y); // prints: 8
</code></pre>

<p>Is this method of assignment valid? Will this method bring any problems?</p>

<p>Also using the same technique we can swap two variables:</p>

<pre><code>var a = 1;
var b = 2;
[a,b] = [b,a];
</code></pre>

<p>I just wanted to know what problems will arise in future with this type of assignment? Where can I find the best reference relating to this type of assignments?</p>
