Update function-table-clone.md

This commit is contained in:
Arseny Kapoulkine 2022-02-14 10:26:00 -08:00 committed by GitHub
parent d6d65940db
commit 480ccd2d45
Signed by: DevComp
GPG key ID: 4AEE18F83AFDEB23

View file

@ -28,6 +28,7 @@ The table can be modified after cloning; as such, a primitive like `Object.assig
`table.clone(t)` is functionally equivalent to the following code, but it's more ergonomic (on the account of being built-in) and significantly faster:
```lua
assert(type(t) == "table")
local nt = {}
for k,v in pairs(t) do
nt[k] = v