Replace int element from another element keeping the original

Hi, i want to save an array my_array = [1,2,3,4,5] and replace a element from my_array with a value, but i don’t want to change my principal array.
For example,

my_array = [1,2,3,4,5]
replace 2 for 8
new_array = [1,8,3,4,5]

Then, if print my_array = [1,2,3,4,5] and new_array = [1,8,3,4,5]
Is there a function that does that?

Thanks!

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