How To | Return the length of a table in Lua
Understand how to return the length of a table in Lua, with detailed steps and examples.
Your engagement helps us create the content you need. Click here to review this article.
Table of Contents
Procedure
To obtain the length of a table, use the length operator (#) in front of the table. For example:
myTable = {"value1", "value2", "value3"}
print(#myTable)