Garry's Mod Wiki


  table table.Add( table target, table source )


Adds all values from source table into the target table. This is most useful for sequential tables, not "dictionary" or "map" tables. See table.Merge if you want to merge 2 tables into one.

See table.insert for a function that adds a single value, and table.Inherit for a function that inherits keys from one table to another.


1 table target
The table to insert the new values into.
2 table source
The table to retrieve the values from.


1 table
The target table.


Demonstrates the use of this function. Note that duplicate values will be added.

local Test1 = {"One","Two","Three", "Four"} local Test2 = {"Four", "Five", "Six"} table.Add( Test1, Test2 ) print( table.concat(Test1, " ") )
One Two Three Four Four Five Six