How to modify array t=[1,2,3] in function like
function dosth!( arg )
. . .
end
In body i wanna in first case change my array to empty(arg = [ ] ), in second case change table something like ( arg = arg[2:end] )
There’s an important difference: popfirst!(t) modifies the array itself, while t = t[2:3] creates a completely new array and then assigns the name t to that new array. In one case the modification will be visible outside of the function and in the other case it will not.