There is a convention that a scalar value can be used in the same way as an N-dimensional array, provided that it is always accessed at index 1:
julia> x = 42
42
julia> x[1]
42
julia> x[1, 1]
42
julia> x[1, 1, 1]
42
The above works, because all non-existing axes are accessed only at index 1. As soon as you try to access another index, you get an out-of-bounds error:
julia> x[2]
ERROR: BoundsError
Stacktrace:
[1] getindex(::Int64, ::Int64) at ./number.jl:78
[2] top-level scope at REPL[13]:1
julia> x[1, 2]
ERROR: BoundsError
Stacktrace:
[1] getindex(::Int64, ::Int64, ::Int64) at ./number.jl:83
[2] top-level scope at REPL[14]:1
In the same way, any N-dimensional array can be used as an M-dimensional array (with M>N), provided that all extra axes are accessed at index 1. These all work:
julia> A = rand(10);
julia> A[2,1]
0.9346414306362032
julia> A[2,1,1]
0.9346414306362032
but the following does not:
julia> A[2,2]
ERROR: BoundsError: attempt to access 10-element Array{Float64,1} at index [2, 2]
Stacktrace:
[1] getindex(::Array{Float64,1}, ::Int64, ::Int64) at ./array.jl:729
[2] top-level scope at REPL[18]:1
This is documented with more details in
https://docs.julialang.org/en/v1/manual/arrays/#Omitted-and-extra-indices-1