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

doc: rename field default to init for array

This commit is contained in:
sudo-nice 2020-05-14 11:00:13 +03:00 committed by GitHub
parent 70b76a8e31
commit b233c24d19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -377,7 +377,7 @@ names = [] // The array is now empty
users := []User{}
// We can also preallocate a certain amount of elements.
ids := []int{ len: 50, default: 0 } // This creates an array with 50 zeros
ids := []int{ len: 50, init: 0 } // This creates an array with 50 zeros
```
The type of an array is determined by the first element: `[1, 2, 3]` is an array of ints (`[]int`).