From ed80bd1410a5f586ab8f03825d74a6d8796e633f Mon Sep 17 00:00:00 2001 From: Colter <32916571+Goldenlion5648@users.noreply.github.com> Date: Thu, 12 Nov 2026 10:35:53 -0500 Subject: [PATCH] Fix example to actually get 2nd and 4th item --- doc/src/content/docs/doc/data-structures/comprehensions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/src/content/docs/doc/data-structures/comprehensions.md b/doc/src/content/docs/doc/data-structures/comprehensions.md index 1dee5ea..fbf65e5 100644 --- a/doc/src/content/docs/doc/data-structures/comprehensions.md +++ b/doc/src/content/docs/doc/data-structures/comprehensions.md @@ -317,7 +317,7 @@ Slicing can also be used as an expression. This is useful for getting a sub-list ```yuescript -- take the 2nd and 4th items as a new list -sub_list = items[2, 4] +sub_list = items[2, 4, 2] -- take the last 4 items last_four_items = items[-4, -1] @@ -329,7 +329,7 @@ last_four_items = items[-4, -1] ```yue -- take the 2nd and 4th items as a new list -sub_list = items[2, 4] +sub_list = items[2, 4, 2] -- take the last 4 items last_four_items = items[-4, -1]