From 0469e1ce9baf0a54e28f001d13f7c98fb8aae050 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sun, 14 Mar 2021 18:43:08 +0200 Subject: [PATCH] docs: make the slice example less ambiguous --- doc/docs.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/docs.md b/doc/docs.md index e4a46a81b1..8d13fe0c32 100644 --- a/doc/docs.md +++ b/doc/docs.md @@ -763,10 +763,10 @@ If a right-side index is absent, it is assumed to be the array length. If a left-side index is absent, it is assumed to be 0. ```v -nums := [1, 2, 3, 4, 5] -println(nums[1..4]) // [2, 3, 4] -println(nums[..4]) // [1, 2, 3, 4] -println(nums[1..]) // [2, 3, 4, 5] +nums := [0, 10, 20, 30, 40] +println(nums[1..4]) // [10, 20, 30] +println(nums[..4]) // [0, 10, 20, 30] +println(nums[1..]) // [10, 20, 30, 40] ``` All array operations may be performed on slices.