Skip to content

Commit 350a179

Browse files
committed
table.values
1 parent 56dd9cc commit 350a179

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

docs/Runtime Environment/Table.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,13 +247,28 @@ Returns a new array-like table containing all keys from the table.
247247
local t = {
248248
["key1"] = "value1",
249249
["key2"] = "value2",
250-
"sequence",
251-
"sequence sequence"
250+
"foo",
251+
"bar"
252252
}
253253
254254
print(dumpvar(t:keys())) -- { 1, 2, "key1", "key2" }
255255
```
256256
---
257+
### `table.values`
258+
Returns a new array-like table containing all values from the table.
259+
#### Parameters
260+
1. The table.
261+
```pluto
262+
local t = {
263+
["key1"] = "value1",
264+
["key2"] = "value2",
265+
"foo",
266+
"bar"
267+
}
268+
269+
print(dumpvar(t:values())) -- { "foo", "bar", "value1", "value2" }
270+
```
271+
---
257272
### `table.countvalues`
258273
Returns a key-value based table which describes how many times a value appears inside of a table.
259274
#### Parameters

0 commit comments

Comments
 (0)