count(table,[val]): integer

Overview

count returns the length of the table table, identical to table #table.

If [val] is set, it returns the amount of instances of [val] in the table.

Arguments

table: table

The table you would like to get the length of.

[val]: integer|nil

If [val] is set, it returns the amount of instances of [val] in the table.

Returns

length: integer

The length of the table, or the amount of instances of [val] if [val] is set.