title: Choose a random item from a table
body: <p>My goal is to pick out a random item from a table in Lua.</p>
  
  <p>This is what I've got so far, but it currently does not work:</p>
  
  <pre><code>local myTable = { 'a', 'b', 'c', 'd' }
  print( myTable[ math.random( 0, #myTable - 1 ) ] )
  </code></pre>
  
  <p>How can I fix the above code so that it works as intended? (Or which other method could I use?)</p>