title: Pad out array with "0" if length less than
body: <p>I have an array that <code>split</code> from <code>.</code> in the string:</p>
  <p>Input data: <code>1.2.3.4.5.6</code></p>
  <p>Output data: <code>[&quot;1&quot;, &quot;2&quot;, &quot;3&quot;, &quot;4&quot;, &quot;5&quot;, &quot;6&quot;]</code></p>
  <p>However, the input data can be any numbers up to 6 items for the output (<code>1</code> or <code>1.2.3</code>).</p>
  <p>I was trying to figure out what is the easiest way to pad the array out to 6 items in the array if less than the maximum?</p>
  <p>I tried <code>concat</code>ing them, but that just appends <code>[&quot;0&quot;, &quot;0&quot;, &quot;0&quot;, &quot;0&quot;, &quot;0&quot;, &quot;0&quot;]</code> to the end, and without a key value I'm not sure how to match them.</p>
  <p>So in the above, if the input was <code>1</code> the output would be <code>[&quot;1&quot;, &quot;0&quot;, &quot;0&quot;, &quot;0&quot;, &quot;0&quot;, &quot;0&quot;]</code>. If the input was <code>1.2.3.4</code> the output would be <code>[&quot;1&quot;, &quot;2&quot;, &quot;3&quot;, &quot;4&quot;, &quot;0&quot;, &quot;0&quot;]</code></p>