mirror of
https://github.com/TangentFoxy/lume.git
synced 2024-11-19 07:04:24 +00:00
Improved description of lume.extend()
in README
This commit is contained in:
parent
cb95fea004
commit
300f47456f
@ -100,8 +100,7 @@ lume.clear(t) -- `t` becomes {}
|
|||||||
|
|
||||||
### lume.extend(t, ...)
|
### lume.extend(t, ...)
|
||||||
Copies all the fields from the source tables to the table `t` and returns `t`.
|
Copies all the fields from the source tables to the table `t` and returns `t`.
|
||||||
Tables are iterated in order, so the right-most table overrides existing
|
If a key exists in multiple tables the right-most table's value is used.
|
||||||
fields.
|
|
||||||
```lua
|
```lua
|
||||||
local t = { a = 1, b = 2 }
|
local t = { a = 1, b = 2 }
|
||||||
lume.extend(t, { b = 4, c = 6 }) -- `t` becomes { a = 1, b = 4, c = 6 }
|
lume.extend(t, { b = 4, c = 6 }) -- `t` becomes { a = 1, b = 4, c = 6 }
|
||||||
|
Loading…
Reference in New Issue
Block a user