diff --git a/doc/docs.md b/doc/docs.md index 8ac9ff5b21..04f5b4b45b 100644 --- a/doc/docs.md +++ b/doc/docs.md @@ -524,6 +524,24 @@ println(upper) // ['HELLO', 'WORLD'] `it` is a builtin variable which refers to element currently being processed in filter/map methods. +#### Multidimensional Arrays + +Arrays can have more than one dimension. + +2d array example: +```v +mut a := [][]int{len:2, init: []int{len:3}} +a[0][1] = 2 +println(a) // [[0, 2, 0], [0, 0, 0]] +``` + +3d array example: +```v +mut a := [][][]int{len:2, init: [][]int{len:3, init: []int{len:2}}} +a[0][1][1] = 2 +println(a) // [[[0, 0], [0, 2], [0, 0]], [[0, 0], [0, 0], [0, 0]]] +``` + ### Maps ```v