# Possible bug in prepend!?

**URL:** <https://discourse.julialang.org/t/possible-bug-in-prepend/54917>\
**Category:** New to Julia\
**Created:** [February 9, 2021, 10:56am UTC](https://discourse.julialang.org/t/possible-bug-in-prepend/54917 "2021-02-09T10:56:05Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [February 9, 2021, 11:00am UTC](https://discourse.julialang.org/t/possible-bug-in-prepend/54917/2 "2021-02-09T11:00:41Z")

</div>

You are looking for `pushfirst!`. `prepend!`, like `append!`, expects multiple entries to iterate over and push into the collection.

Examples:

```julia
julia> A = Int[0]
1-element Vector{Int64}:
 0

julia> push!(A, 1)
2-element Vector{Int64}:
 0
 1

julia> pushfirst!(A, -1)
3-element Vector{Int64}:
 -1
  0
  1

julia> append!(A, [2, 3])
5-element Vector{Int64}:
 -1
  0
  1
  2
  3

julia> prepend!(A, [-3, -2])
7-element Vector{Int64}:
 -3
 -2
 -1
  0
  1
  2
  3

```

---

_[View the full topic](https://discourse.julialang.org/t/possible-bug-in-prepend/54917)._
