Skip to Content
API Referencenum_array (empty number array)

num_array (empty number array)

num_array() -> Array<Number>

Returns an empty array meant for numbers. Used as a helper function to allow shorthand arithmetic operators +, -, *, /, and ^ to be used with the resulting array.

Example:

local custom_array = {8, 9} local proper_array = num_array() proper_array[1] = 8 proper_array[2] = 9 local t = proper_array + {3, 4} -- this is OK local t = custom_array + {3, 4} -- this will produce an error local t = proper_array - custom_array -- this is OK again

See also bool_array