title: Replace a table value for a key in lua
body: <p>I need to do replace a value for a key in lua, for example consider a table </p>
  
  <pre><code>t = {"book", "ball", "bank"}
  </code></pre>
  
  <p>here I need to change the value for "box" instead of "ball". how to do that ? </p>
  
  <p>previously I tried as finding the value a key and change, but it didn't work!!!</p>
  
  <pre><code>for key, value in pairs(t) do
    if key == 2 then
      value = "box"
    end
  end
  </code></pre>
  
  <p>but it didn't work.. if anyone knows alternative way please give me suggestions?</p>