title: Loop over array and create a Query
body: <p>I have a list of values in a array, I need to create a query based on that</p>
  
  <pre><code>var x = [1, 2, 3, 4, 5];
  
  url = http://localhost:3000/site/query=("ID:"+ 1 + "ID:" + 2 + "ID:" + 3)
  </code></pre>
  
  <p>the number of ID increases based on values in an array.</p>
  
  <p>I tried creating a for loop and than add i for example:</p>
  
  <pre><code>for (var i = 0; i &lt; x.length; i++) {
    if (i === 0) {
      url = http://localhost:3000/site/query=("ID:"+ x[i])
    }
    if (i === 1) {
      url = http://localhost:3000/site/query=("ID:"+ x[0] + "ID:" + x[i])
    }
  }
  </code></pre>
  
  <p>I cannot create multiple if blocks because the "i"value can be dynamic and there could be many values in array</p>