title: Hi. I have a question about lua, specifically creating local tables and returning them
body: <pre><code>function createtable()
  local table = {}
  -- insert stuff into table like references to stuff or variables
  return table
  end
  
  
  -- we'll use a different table
  local globaltable = createtable()
  </code></pre>
  <p>My question is do we now have 2 tables?</p>
  <p>What happens if I do <code>globaltable = nil</code>. Does the local table still exist and hold those references?<br />
  If I edit something in the local table such as removing everything in the local table after returning it will it influence the globaltable?</p>
  <p>This is so confusing!!</p>
  <p>I don't want memory to be building up.<br />
  For context I'm making a game on roblox and their code uses LUA which is interpreted by C or smth.<br />
  What I want to do is ensure that references are removed when they're no longer needed.</p>