A one dimensional array is an array for which you have to give a single argument (called index) to access a specific value.
E.G. with the following one dimensional array
array = [0,1,2,9,6,5,8]
The array at index 1 has the value 1. The array at index 3 has value 9. If you want to update the 3rd value to 8 in the array, you should do
array[2] = 8
A two-dimensional array is simply an array of arrays. So, you have to give two arguments to access a single value.
two_dim_array = [[1,2,3],[4,5,6],[7,8,9]]
If you want to update the 'second' value, you have to do
two_dim_array[0][1] = 'something'
That is because two_dim_array[0]
is a one-dimensional array, and you still have to specify an index to access a value.
From now on, you can keep going deeper with the same reasoning. As any further dimension is another level in the list. So a three dimensional array would be :
3d_array =
[
[
[1,2,3,4],
[5,6,7,8]
],
[
[9,10,11,12],
[13,14,15,16]
]
]
Now to access a value you have to give .. 3 parameters. Because
3d_array[0] // is a two-dim array
3d_array[0][1] // is a one-dim array
3d_array[0][1][0] // is a value
I suggest you start doing simple exercices to get you familiar with this concept, as it is really 101 programming stuff. W3resource has great exercices to get you started.