table.Add

From Garry's Mod
Jump to: navigation, search
 table.Add( )

Contents

Description

Adds the contents from one table into another. The target table will be modified.

See also table.Inherit and table.Merge.

Arguments

table target

The table to insert the new values into.

Arguments

table source

The table to retrieve the values from.

Returns

table

The target table.

Examples

Example

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, " ") )

Output:


One Two Three Four Four Five Six
Personal tools
Navigation