From c362dc29a44a5276afa1ef7e8f6eba969e1468d7 Mon Sep 17 00:00:00 2001 From: Li Jin Date: Wed, 4 Jun 2025 17:02:34 +0800 Subject: Updated docs. [skip CI] --- doc/docs/doc/README.md | 8 ++++---- doc/docs/zh/doc/README.md | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'doc') diff --git a/doc/docs/doc/README.md b/doc/docs/doc/README.md index a607036..a474131 100755 --- a/doc/docs/doc/README.md +++ b/doc/docs/doc/README.md @@ -591,13 +591,13 @@ merge = {...a, ...b} You can use the **#** operator to get the last elements of a table. ```moonscript -print data.items[#] -- get the last element of a table -print data.items[#-1] -- get the second last element of a table +last = data.items[#] +second_last = data.items[#-1] ```
-print data.items[#] -- get the last element of a table
-print data.items[#-1] -- get the second last element of a table
+last = data.items[#]
+second_last = data.items[#-1]
 
diff --git a/doc/docs/zh/doc/README.md b/doc/docs/zh/doc/README.md index 7ff205c..9669231 100755 --- a/doc/docs/zh/doc/README.md +++ b/doc/docs/zh/doc/README.md @@ -590,13 +590,13 @@ merge = {...a, ...b} 你可以使用 **#** 操作符来反向索引表中的元素。 ```moonscript -print data.items[#] -- 获取表的最后一个元素 -print data.items[#-1] -- 获取表的倒数第二个元素 +last = data.items[#] +second_last = data.items[#-1] ```
-print data.items[#] -- 获取表的最后一个元素
-print data.items[#-1] -- 获取表的倒数第二个元素
+last = data.items[#]
+second_last = data.items[#-1]
 
-- cgit v1.2.3-55-g6feb