mirror of
https://github.com/TangentFoxy/lume.git
synced 2025-07-28 02:52:21 +00:00
Added function lume.extend()
, updated README and tests
This commit is contained in:
@@ -98,6 +98,15 @@ local t = { 1, 2, 3 }
|
||||
lume.clear(t) -- `t` becomes {}
|
||||
```
|
||||
|
||||
### lume.extend(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
|
||||
fields.
|
||||
```
|
||||
local t = { a = 1, b = 2 }
|
||||
lume.extend(t, { b = 4, c = 6 }) -- `t` becomes { a = 1, b = 4, c = 6 }
|
||||
```
|
||||
|
||||
### lume.shuffle(t)
|
||||
Returns a shuffled copy of the array `t`.
|
||||
|
||||
|
Reference in New Issue
Block a user