You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Perhaps, that section could clarify that when an lvalue is splatted and it does not have enough corresponding rvalues, it is assigned an empty array and not nil. For example,
a, b = 1 #=> a=1, b=nil
whereas,
a,*b=1 #=> a=1, b=[]
The text was updated successfully, but these errors were encountered:
First off, excellent discussion on splat operator at: http://ruby.runpaint.org/variables#splat-lvalue
Perhaps, that section could clarify that when an lvalue is splatted and it does not have enough corresponding rvalues, it is assigned an empty array and not nil. For example,
a, b = 1 #=> a=1, b=nil
whereas,
a,*b=1 #=> a=1, b=[]
The text was updated successfully, but these errors were encountered: