title: bad argument #1 to 'insert' (table expected, got nil) error in love2d lua
body: <p>i keep receiving an error when i try to run my lua script.
  The error is: bad argument #1 to 'insert' (table expected, got nil)</p>
  
  <p>here is my gameloop code:</p>
  
  <pre><code>local GameLoop = {}
  
  local insert = table.insert
  local remove = table.remove
  
  function GameLoop:create()
  
      local gameLoop = {}
  
      function gameLoop:addLoop(obj)
  
          insert(self.clocks,obj)
  
      end
  
      function gameLoop:update(dt)
  
          for clocks = 0,#self.clocks do
              local obj = self.clocks[clocks]
              if obj ~= nil then
                  obj:tick(dt)
              end
          end
  
      end
  
  return gameLoop
  
  end
  
  return GameLoop
  </code></pre>