Last active
August 23, 2017 09:14
-
-
Save akornatskyy/1476cfadb5e708d20775f7433d4e1e2c to your computer and use it in GitHub Desktop.
Lua: How to merge two tables
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local function tblmerge(t1, t2) | |
| local r = {} | |
| for k, v in next, t1 do | |
| r[k] = v | |
| end | |
| for k, v in next, t2 do | |
| r[k] = v | |
| end | |
| return r | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment