Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 386 Bytes

how-to-remove-an-element-from-array.md

File metadata and controls

24 lines (18 loc) · 386 Bytes

How to remove an element from array

table.remove(arr, 2)
  • table.remove - will remove an element at given position
  • arr - array to remove element from
  • 2 - position to remove an element from

group: array_add

Example:

arr = {1, 2, 3}
table.remove(arr, 2)
print(table.concat(arr, ', '))
1, 3

link_youtube: https://youtu.be/FAb1DmFGMAE