ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Client functions
  3. markAsArray

Function

markAsArray

ClientBrowserTrilogy Hub only

Marks a table as a list: an empty table reaches the browser page (triggerBrowserEvent, toJSON) as [] instead of {}. Returns the same table.

Syntax

table markAsArray(table t)

Arguments

ttable
The table.

Returns

The same table; false if the table already has a different metatable.

Example

local items = markAsArray({})  -- strona dostanie pusta liste []
triggerBrowserEvent(browser, "onItems", items)

See also