From: Love U Ruby Date: 2013-03-12T13:41:09+09:00 Subject: Re: Confusion with empty block printing here I am making my confusions are more specific: >> print(1..2).class 1..2=> NilClass >> print (1..2).class Range=> nil Why the below 2 produces different output? How does `IRB` read the above? >> print[].class NoMethodError: undefined method `[]' for nil:NilClass from (irb):5 from C:/Ruby193/bin/irb:12:in `
' >> print [].class Array=> nil How does `IRB` read the above? >> print{}.class => NilClass >> print {}.class => NilClass Why here both lines giving the same outputs unlike the above 2 ? -- Posted via http://www.ruby-forum.com/.