title: Is there a way to declare a variable by adding a variable name with a variable value?
body: <p>I have some arrays:</p>
  <pre><code>var orderObj1 = [], orderObj2  = [], orderObj3 = [], orderObj4 = [], orderObj5 = [], orderObj6= [];
  </code></pre>
  <p>And I'm trying to do something like this:</p>
  <pre><code>for (let [key, value] of Object.entries(req.user.orders[z])) {
    if (key == orderName[a] + &quot;Name&quot;) {
    a + 1;
    var ordName = orderObj + a;
    ordName.push(value);
   }
  </code></pre>
  <p>The end goal is <code>ordName = orderObj1</code>, and as <code>a</code> increases, <code>ordName</code> will reference <code>orderObj2</code>, <code>orderObj3</code> and so on. The value of <code>a</code> initially is 0.</p>