Replace int element from another element keeping the original

julia> replace([1, 2, 3, 4, 5], 2 => 8)
5-element Vector{Int64}:
 1
 8
 3
 4
 5
1 Like