rawget()

Type Function
Library (globals)
Return value (varies)
Revision Release 2022.3683
Keywords rawget, rawset, tables
See also rawset()

Overview

Gets the real value of table[index], without invoking any metamethod. table must be a Table; index may be any Number or String.

Syntax

rawget( table, index )
table (required)

Table. Any table.

indexG2 (required)

Number or String. Index into table (that you want to "get" the real value of).

Example

local t = {
    sample = "example value",
    another = 12345
}

print( rawget( t, "sample" ) )

-- OUTPUT: "example value"