title: How to initialize table size in lua
body: <p>What is the most efficient way to convert number to table? Or is it possible to make a table <strong>without loops</strong>?</p>
  
  <pre><code>local t = 10 -- given number
  {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} -- result
  </code></pre>
  
  <p>Update: the <code>t</code> variable is mutable number and I want to for each the value.</p>
  
  <pre><code>t = 3
  
  function foreach(f, t)
    for i, v in ipairs(t) do
      f(v)
    end   
  end
  
  foreach(print, t)
  1
  2
  3
  </code></pre>
  
  <p>I need a just the quickest way of <code>new Array(n)</code> in Lua. Or doesn't make any sense?</p>