When I write the following code:
x= [1,2,3]
x << x
puts x
puts x[3]
puts x[3][3][3][3][3][3][3][3][3][3]
I get this output:
[1, 2, 3, [...]]
[1, 2, 3, [...]]
[1, 2, 3, [...]]
Should I get only [1,2,3, [1,2,3]] and what will be the explanation?
source
share