snippet for creating object from destructured array : <p>For example, I had an array with 3 numbers:</p>

<pre><code>var arr = [124, -50, 24];
</code></pre>

<p>and I need to convert this array to the object:</p>

<pre><code>{
   x: 124,
   y: -50,
   z: 24
}
</code></pre>

<p>I don`t want to use "old-style" syntax for this, for example:</p>

<pre><code>{
  x: arr[0],
  y: arr[1],
  z: arr[2]
}
</code></pre>

<p>so for now, I`m using that syntax:</p>

<pre><code>const [x, y, z] = [...arr];
const obj = {x, y, z};
</code></pre>

<p>But, is there is any way to do this with a straight dectructuring array to object without need of temporary variables?</p>
