a = [1,2,3,4]
b = a << 5
a == [1,2,3,4] # returns false
How to assign b to a with 5 appended to the end without modifying a itself?
Just sum two arrays:
a = [1,2,3,4]
b = a + [5]
# b == [1, 2, 3, 4, 5]
# a == [1, 2, 3, 4]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With