table.CollapseKeyValue

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

Contents

Description

Collapses a table with keyvalue structure

Arguments

table input

Input table

Returns

table

Output table

Examples

Example

Example usage

local output = table.CollapseKeyValue( {
	{ Key = "mykey1", Value = "myvalue1" },
	{ Key = 123, Value = 1345 },
	{ Key = 1345, Value = "myvalue1" },
} )

Output:

local output = {
	[ "mykey1" ] = "myvalue1",
	[ 123 ] = 1345,
	[ 1345 ] = "myvalue1",
}
Personal tools
Navigation