# How to understand the keyword \`where\` in the array type signature

**URL:** https://discourse.julialang.org/t/how-to-understand-the-keyword-where-in-the-array-type-signature/53856
**Category:** General Usage
**Created:** [January 24, 2021, 4:37am UTC](https://discourse.julialang.org/t/how-to-understand-the-keyword-where-in-the-array-type-signature/53856 "2021-01-24T04:37:50Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![chkwon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chkwon/32/3632_2.png) [@chkwon](https://discourse.julialang.org/u/chkwon)
#### Post date: [January 24, 2021, 4:37am UTC](https://discourse.julialang.org/t/how-to-understand-the-keyword-where-in-the-array-type-signature/53856/1 "2021-01-24T04:37:50Z")

</div>

```julia
a = Array{Int}[]
push!(a, [1 2; 3 4])
@show typeof(a)

```

```julia
Array{Array{Int64,N} where N,1}

```

In the above, how should I read `where N,1`? Especially, what does `1` represent here?

How may I create a variable of type `Array{Array{Int64,N} where N,2}`?

---

<div class="post-metadata">

### Author: ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)
#### Post date: [January 24, 2021, 4:55am UTC](https://discourse.julialang.org/t/how-to-understand-the-keyword-where-in-the-array-type-signature/53856/2 "2021-01-24T04:55:32Z")

</div>

actually, the `1` goes with the outermost `Array`, the meaning of this type is:  
“Array of 1 dimension, and element of this array is of type `Array{Int64, N}`”,

the `where N` means `N` is not specified, such that it is possible to push vector or even a higher dimensional tensor into `a`:

```julia
julia> push!(a, rand(Bool, 2,2,2))
2-element Vector{Array{Int64, N} where N}:

julia> a[1]
2×2 Matrix{Int64}:

julia> a[2]
2×2×2 Array{Int64, 3}:

```

* * *

Maybe this will also help you understand:

```julia
julia> [[1 2;3 4]]
1-element Vector{Matrix{Int64}}:

julia> Matrix{Int64} == Array{Int64,2}
true

```

The reason why your original example didn’t return a

```julia
Array{Matrix{Int64}, 1}

```

is because you specifically wanted the flexibility in `N`:

```julia
julia> Array{Int}
Array{Int64, N} where N

```

---

<div class="post-metadata">

### Author: ![chkwon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chkwon/32/3632_2.png) [@chkwon](https://discourse.julialang.org/u/chkwon)
#### Post date: [January 24, 2021, 5:08am UTC](https://discourse.julialang.org/t/how-to-understand-the-keyword-where-in-the-array-type-signature/53856/3 "2021-01-24T05:08:01Z")

</div>

Ah! Thanks. Makes sense. Can’t believe I couldn’t catch it 😃
