diff options
Diffstat (limited to 'doc/docs')
-rwxr-xr-x | doc/docs/doc/README.md | 8 | ||||
-rwxr-xr-x | doc/docs/zh/doc/README.md | 8 |
2 files changed, 8 insertions, 8 deletions
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} | |||
591 | You can use the **#** operator to get the last elements of a table. | 591 | You can use the **#** operator to get the last elements of a table. |
592 | 592 | ||
593 | ```moonscript | 593 | ```moonscript |
594 | print data.items[#] -- get the last element of a table | 594 | last = data.items[#] |
595 | print data.items[#-1] -- get the second last element of a table | 595 | second_last = data.items[#-1] |
596 | ``` | 596 | ``` |
597 | <YueDisplay> | 597 | <YueDisplay> |
598 | <pre> | 598 | <pre> |
599 | print data.items[#] -- get the last element of a table | 599 | last = data.items[#] |
600 | print data.items[#-1] -- get the second last element of a table | 600 | second_last = data.items[#-1] |
601 | </pre> | 601 | </pre> |
602 | </YueDisplay> | 602 | </YueDisplay> |
603 | 603 | ||
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} | |||
590 | 你可以使用 **#** 操作符来反向索引表中的元素。 | 590 | 你可以使用 **#** 操作符来反向索引表中的元素。 |
591 | 591 | ||
592 | ```moonscript | 592 | ```moonscript |
593 | print data.items[#] -- 获取表的最后一个元素 | 593 | last = data.items[#] |
594 | print data.items[#-1] -- 获取表的倒数第二个元素 | 594 | second_last = data.items[#-1] |
595 | ``` | 595 | ``` |
596 | <YueDisplay> | 596 | <YueDisplay> |
597 | <pre> | 597 | <pre> |
598 | print data.items[#] -- 获取表的最后一个元素 | 598 | last = data.items[#] |
599 | print data.items[#-1] -- 获取表的倒数第二个元素 | 599 | second_last = data.items[#-1] |
600 | </pre> | 600 | </pre> |
601 | </YueDisplay> | 601 | </YueDisplay> |
602 | 602 | ||