1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

all: rename it to index in array inits (#17543)

This commit is contained in:
ChAoS_UnItY
2023-03-09 03:51:45 +08:00
committed by GitHub
parent 2597efa7f6
commit ae6a48c0e3
17 changed files with 75 additions and 62 deletions

View File

@ -946,14 +946,14 @@ for i in 0 .. 1000 {
> **Note**
> The above code uses a [range `for`](#range-for) statement.
You can initialize the array by accessing the `it` variable which gives
You can initialize the array by accessing the `index` variable which gives
the index as shown here:
```v
count := []int{len: 4, init: it}
count := []int{len: 4, init: index}
assert count == [0, 1, 2, 3]
mut square := []int{len: 6, init: it * it}
mut square := []int{len: 6, init: index * index}
// square == [0, 1, 4, 9, 16, 25]
```