Module:Util/tables/property

From Zelda Wiki, the Zelda encyclopedia
Jump to navigation Jump to search

The curried version of this function is used interally by Module:Util/tables/iteratee. The non-curried version has no foreseeable use and exists only for the sake of completeness.

property(tbl, key)

Returns

  • The value of tbl[key]

Examples

#InputOutputStatus
1
property({ foo = "bar" }, "foo")
"bar"
2
property({ foo = "bar" }, "baz")
nil

local function property(tbl, key)
	return tbl[key]
end

return property