title: Split a string straight into variables
body: <p>I’d like to know if standard JS provides a way of splitting a string straight into a set of variables during their initial declaration. For example in Perl I would use:</p>
  <pre class="lang-perl prettyprint-override"><code>my ($a, $b, $c) = split '-', $str;
  </code></pre>
  <p>In Firefox I can write</p>
  <pre class="lang-js prettyprint-override"><code>var [a, b, c] = str.split('-');
  </code></pre>
  <p>But this syntax is not part of the ECMAScript 5th edition and as such breaks in all other browsers. What I’m trying to do is avoid having to write:</p>
  <pre class="lang-js prettyprint-override"><code>var array = str.split('-');
  var a = array[0];
  var b = array[1];
  var c = array[2];
  </code></pre>
  <p>Because for the code that I’m writing at the moment such a method would be a real pain, I’m creating 20 variables from 7 different splits and don’t want to have to use such a verbose method.</p>
  <p>Does anyone know of an elegant way to do this?</p>