title: Javascript: What does this `Array(i+1)` do?
body: <p>Hi I found a solution for a problem on codewars and I'm not sure what a piece of the syntax does. The function takes a string of characters, and based on the length, returns it in a certain fashion.</p>
  
  <p>input = "abcd"; output = "A-Bb-Ccc-Dddd"
  input = "gFkLM"; output = "G-Ff-Kkk-Llll-Mmmmm"</p>
  
  <p>This guy posted this solution </p>
  
  <pre><code>function accum(str) {
    var letters = str.split('');
    var result = [];
    for (var i = 0; i &lt; letters.length; i++) {
      result.push(letters[i].toUpperCase() + Array(i + 1).join(letters[i].toLowerCase()));
    }
    return result.join('-');
  }
  </code></pre>
  
  <p>Kinda confused about the solution overall, but one thing is particularly nagging me. See that <code>Array(i + 1)</code> ? What does that do? Sorry, not a very easy thing to google.</p>