diff --git a/README.md b/README.md index be54ddb0..e358fa18 100644 --- a/README.md +++ b/README.md @@ -348,17 +348,17 @@ fn init { An array is a finite sequence of values constructed using square brackets `[]`, with elements separated by commas `,`. For example: ```go -let array = [1, 2, 3, 4] +let numbers = [1, 2, 3, 4] ``` -You can use `array[x]` to refer to the xth element. The index starts from zero. +You can use `numbers[x]` to refer to the xth element. The index starts from zero. ```go live fn init { - let array = [1, 2, 3, 4] - let a = array[2] - array[3] = 5 - let b = a + array[3] + let numbers = [1, 2, 3, 4] + let a = numbers[2] + numbers[3] = 5 + let b = a + numbers[3] print(b) // prints 8 } ``` diff --git a/zh-docs/README.md b/zh-docs/README.md index 503ea2ae..fceb0d65 100644 --- a/zh-docs/README.md +++ b/zh-docs/README.md @@ -351,17 +351,17 @@ fn init { 数组是由方括号 `[]` 构造的有限值序列,其中元素由逗号 `,` 分隔。例如: ```rust -let array = [1, 2, 3, 4] +let numbers = [1, 2, 3, 4] ``` -可以用 `array[x]` 来引用第 `x` 个元素。索引从零开始。 +可以用 `numbers[x]` 来引用第 `x` 个元素。索引从零开始。 ```rust live fn init { - let array = [1, 2, 3, 4] - let a = array[2] - array[3] = 5 - let b = a + array[3] + let numbers = [1, 2, 3, 4] + let a = numbers[2] + numbers[3] = 5 + let b = a + numbers[3] print(b) // 打印 8 } ```