# Why does Array{Int}() product Array{Int, 0} and not Array{Int, 1}

**URL:** <https://discourse.julialang.org/t/why-does-array-int-product-array-int-0-and-not-array-int-1/11298>\
**Category:** New to Julia\
**Created:** [May 31, 2018, 5:29pm UTC](https://discourse.julialang.org/t/why-does-array-int-product-array-int-0-and-not-array-int-1/11298 "2018-05-31T17:29:29Z")\
**Posts on this page:** 1\
**Showing post:** 20

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [June 3, 2018, 9:29am UTC](https://discourse.julialang.org/t/why-does-array-int-product-array-int-0-and-not-array-int-1/11298/20 "2018-06-03T09:29:44Z")

</div>

> [@Tamas\_Papp](#):
>
> I missed the use case for that, can you give an example? Eg `Vector{T}()` is used because I can `push!` into it, but I don’t think I have ever created an array with size `(0, 0, ..., 0)` .

It’s useful as a type stable default argument value. Assuming for a moment that `Array{T, N}()` would create an empty array.

```julia
function f(x::Array{T, N}, weight = Array{T, N}()) where {T, N}
    if isempty(weight)
        # Compute unweighted special case.
    else
        # Compute the general case.
    end
end

```

Yes, you could use `nothing` to indicate no weight and being a small union it would probably be fast, but full type stability is still an attractive property.

---

_[View the full topic](https://discourse.julialang.org/t/why-does-array-int-product-array-int-0-and-not-array-int-1/11298)._
