aboutsummaryrefslogtreecommitdiff
path: root/doc/docs/id-id
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2026-02-28 16:52:40 +0800
committerLi Jin <dragon-fly@qq.com>2026-02-28 16:52:40 +0800
commit394ee0f64a0dc022f1dab86213d4771982ecf987 (patch)
tree742623d81f4fdd5a2c4998a7735634fcd79ac5e9 /doc/docs/id-id
parent7555271be61990fd5020eac48fc80d6a24886b9c (diff)
downloadyuescript-394ee0f64a0dc022f1dab86213d4771982ecf987.tar.gz
yuescript-394ee0f64a0dc022f1dab86213d4771982ecf987.tar.bz2
yuescript-394ee0f64a0dc022f1dab86213d4771982ecf987.zip
Updated docs.
Diffstat (limited to 'doc/docs/id-id')
-rw-r--r--doc/docs/id-id/doc/language-basics/operator.md26
1 files changed, 26 insertions, 0 deletions
diff --git a/doc/docs/id-id/doc/language-basics/operator.md b/doc/docs/id-id/doc/language-basics/operator.md
index b2b1003..68c96e6 100644
--- a/doc/docs/id-id/doc/language-basics/operator.md
+++ b/doc/docs/id-id/doc/language-basics/operator.md
@@ -138,6 +138,8 @@ tbA[] = ...tbB
138 138
139Anda bisa menggabungkan tabel array atau tabel hash menggunakan operator spread `...` sebelum ekspresi di literal tabel. 139Anda bisa menggabungkan tabel array atau tabel hash menggunakan operator spread `...` sebelum ekspresi di literal tabel.
140 140
141Saat melakukan spread ke literal tabel dengan kurung kurawal (misalnya `{...other}`), bagian array dan bagian hash dari tabel Lua akan disalin.
142
141```yuescript 143```yuescript
142parts = 144parts =
143 * "shoulders" 145 * "shoulders"
@@ -176,6 +178,30 @@ merge = {...a, ...b}
176 178
177</YueDisplay> 179</YueDisplay>
178 180
181### Penyebaran Tabel List
182
183Saat melakukan spread ke literal tabel dengan kurung siku (misalnya `[...other,]`), hanya bagian array yang disalin.
184
185```yuescript
186source = {1, 2, 3, name: "Yue"}
187fullCopy = {...source}
188listCopy = [...source,]
189-- fullCopy => {1, 2, 3, name: "Yue"}
190-- listCopy => [1, 2, 3]
191```
192
193<YueDisplay>
194
195```yue
196source = {1, 2, 3, name: "Yue"}
197fullCopy = {...source}
198listCopy = [...source,]
199-- fullCopy => {1, 2, 3, name: "Yue"}
200-- listCopy => [1, 2, 3]
201```
202
203</YueDisplay>
204
179## Indeks Balik Tabel 205## Indeks Balik Tabel
180 206
181Anda dapat menggunakan operator **#** untuk mendapatkan elemen terakhir dari tabel. 207Anda dapat menggunakan operator **#** untuk mendapatkan elemen terakhir dari tabel.