Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 371 Bytes

how-to-add-item-to-table.md

File metadata and controls

24 lines (18 loc) · 371 Bytes

How to add item to table

table.insert(tbl, 'val')
  • table.insert - will append given value to the given table
  • tbl - name of the table to add item to
  • 'val' - item to add to table

group: table

Example:

tbl = {1, 2}
table.insert(tbl, 3)
print(table.concat(tbl, ', '))
1, 2, 3

link_youtube: https://youtu.be/nmhXxDkFID0