Julia | Adding elements to arrays
You can add elements to arrays either destructively, or not:
Non-destructive:
a = [1, 2, 3]
b = [a; 4] # b is [1, 2, 3, 4]
Destructive:
a = [1, 2, 3]
push!(a, 4) # a is [1, 2, 3, 4]
Resources:
You can add elements to arrays either destructively, or not:
Non-destructive:
a = [1, 2, 3]
b = [a; 4] # b is [1, 2, 3, 4]
Destructive:
a = [1, 2, 3]
push!(a, 4) # a is [1, 2, 3, 4]
Resources: