Let's say I have
a = ["a","b","c","d","e","f","g"]
b = a.map(&:upcase)
a.delete("a")
print b # right now b = ["A","B","C","D","E","F","G"]
# I want b = ["B","C","D","E","F","G"]
I want b to dynamically update itself based on what a has so that, in the end, b prints out without "a" because "a" was removed from a. I want b to be a separate object from a; I do not want to modify a in place (no map!). Is this possible?
a.map(&:upcase)shouldn't modify in place.