Actually does a full copy of a table, instead of referencing the original. This also recursively copies sub-tables.
Functions and userdata/C classes cannot be copied directly and so will be left as references to
the original data. Built-in Lua data types, such as
Checks table 'haystack' for anything that matches 'needle'. If found, returns the table's key that
contains the value. If no match is found, returns
'needle' can be any data type. The key returned depends entirely on the structure of 'haystack' and
will be either a
Recursively dump the table to the standard output. This is useful for debugging. When called from Lua, you probably shouldn't include the depth...
Due to how Lua iterates over tables that are not indexed in the format of 1..n (aka a list, ie. if your table uses any keys that are non-sequential starting at 1, or contain any strings), the order in which items are iterated over is unpredictable. In the below example, you will see that 'age' is output before 'name' because of this, however the 'favoriteFoods' table maintains it's order.
Return a new
If only 'field' is given, the returned
That makes absolutely no sense, so just look at this example instead.
Page last updated at 2018-09-25 20:48:46