It might be that the example is oversimplfied, but note that this is perfectly fine if the type of x does not change:
julia> const x = [1,2]
2-element Vector{Int64}:
1
2
julia> change() = x .+= 1
change (generic function with 1 method)
julia> change()
2-element Vector{Int64}:
2
3
julia> change()
2-element Vector{Int64}:
3
4