# Understanding push!

**URL:** <https://discourse.julialang.org/t/understanding-push/92872>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [January 12, 2023, 11:42am UTC](https://discourse.julialang.org/t/understanding-push/92872 "2023-01-12T11:42:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ditfurth](https://avatars.discourse-cdn.com/v4/letter/d/3e96dc/32.png) [@ditfurth](https://discourse.julialang.org/u/ditfurth)\
**Post date:** [January 12, 2023, 11:42am UTC](https://discourse.julialang.org/t/understanding-push/92872/1 "2023-01-12T11:42:20Z")

</div>

If I want to create a vector with 15 names, where each one is pushed into the vector individually, this code just replaces the former iteration with the new iteration instead of appending to it. Right?

---

<div class="post-metadata">

**Author:** ![mrufsvold](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mrufsvold/32/31600_2.png) [@mrufsvold](https://discourse.julialang.org/u/mrufsvold)\
**Post date:** [January 12, 2023, 12:09pm UTC](https://discourse.julialang.org/t/understanding-push/92872/2 "2023-01-12T12:09:32Z")

</div>

`push!(arr, new_element)` appends the value to the array.

```julia
a = String[]
push!(a, "Bob")
#["Bob"]
push!(a, "Joe")
#["Bob", "Joe"]

```
