When creating a new array in IRB, I can use Array.new to get an empty, unassigned array.
Is there a way to reassign that new array? Can I turn, [] into a variable named my_new_array?
I know I can do this:
my_new_array = Array.new
Or I can do:
my_other_new_array = []
But what about reassigning Array.new?
I’m new to Ruby and I’m curious about this little nuance.
In IRB, the underscore
_method will give you the results of the last expression: