# Initialize Arrays from Ranges, Semicolon explanation

**URL:** <https://discourse.julialang.org/t/initialize-arrays-from-ranges-semicolon-explanation/22559>\
**Category:** New to Julia\
**Created:** [March 31, 2019, 3:22am UTC](https://discourse.julialang.org/t/initialize-arrays-from-ranges-semicolon-explanation/22559 "2019-03-31T03:22:27Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [March 31, 2019, 6:49am UTC](https://discourse.julialang.org/t/initialize-arrays-from-ranges-semicolon-explanation/22559/4 "2019-03-31T06:49:10Z")

</div>

You should read the [docs](https://docs.julialang.org/en/v1/manual/arrays/#Concatenation-1), and this discussion:

> [@How to create a 2x1 Array?](https://discourse.julialang.org/t/how-to-create-a-2x1-array/8337/44):
>
> It was discussed in the lead up to 1.0 whether [1; 2; 3] should construct a vector or a matrix. But note that there’s nothing special about two dimensions in concatenation syntax in general: julia\> [rand(2); rand(2)] 4-element Array{Float64,1}: 0.528860561644692 0.2992626181507161 0.6659761151342882 0.423705081212141 julia\> [rand(2, 2, 2); rand(2, 2, 2)] 4×2×2 Array{Float64,3}: [:, :, 1] = 0.91018 0.0499205 0.136608 0.128014 0.621301 0.0150574 0.58328 0.694085 [:, :, 2] = 0.533…

That said, it is very likely that you want to use `1:10` _as is_ (without allocating an array), or if you want to modify values, `collect(1:10)`.

---

_[View the full topic](https://discourse.julialang.org/t/initialize-arrays-from-ranges-semicolon-explanation/22559)._
