title: How do I create an empty array of arrays in Powershell?
body: <p>I want to create an empty array of arrays in Powershell to hold "tuples" of values (arrays are immutable).</p>
  
  <p>Therefore I try something like:</p>
  
  <p>The type of <code>$arr</code> is <code>Object[]</code>. I've read that <code>+= @(1,2)</code> appends the given element (i.e. <code>@(1,2)</code>) to <code>$arr</code> (actually creates a new array). However, in this case it seems that the arrays are concatenated, why?</p>
  
  <pre><code>$arr = @()
  $arr += @(1,2)
  $arr.Length // 2 (not 1)
  </code></pre>
  
  <p>If I do as follows, it seems that <code>$arr</code> contains the two arrays <code>@(1,2),@(3,4)</code>, which is what I want:</p>
  
  <pre><code>$arr = @()
  $arr += @(1,2),@(3,4)
  $arr.Length // 2
  </code></pre>
  
  <p>How do I initialize an empty array of arrays, such that I can add one subarray at a time, like <code>$arr += @(1,2)</code>?</p>