title: How to create variables with dynamic [incremental] names in Scala
body: <p>I want to create a set of variables with dynamic names and assigning each of them in for loop, for example:</p>
  
  <pre><code>val V1,V2,V3,V4
  
  for (i&lt;- 1 until 5){
     V&lt;i&gt;=doc1.map(array of string)
  }
  </code></pre>
  
  <p>How can i create these variables?</p>