Say your making a script and by the end of it you tell it to return a value. You don't know what kind of value it is but you hope it's a table. How would you go about confirming that the value is a table?
By using the type
function!
1 | tab = { } |
2 | print ( type (tab)) |
3 |
4 | if type (tab) = = "table" then |
5 | print ( "This will print!" ) |
6 | else |
7 | print ( "but this won't! D:" ) |
8 | end |