title: Why is array destructuring not working in this case?
body: <p>I am trying to swap members of arr.
  But I am getting [0, 0] as output.
  I am expecting [1, 0].</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const arr = [0, 1];
  [arr[1],arr[0]] = arr;
  console.log(arr)</code></pre>
  </div>
  </div>
  </p>
  <p>But while doing this, it outputs
  [1, 0] which I think I understand.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const arr = [0, 1];
  [arr[1],arr[0]] = [arr[0], arr[1]];
  console.log(arr)</code></pre>
  </div>
  </div>
  </p>