Nil: a Formal Introduction


I seems from the instructions that if I correctly try to access a key that does not exist I should receive "Nil" as a response. However, I am getting no response at all. So I went back and made a couple of entries to access non-existing keys and one that does exist. I get no "Nil" responses but the key that is present provides the value. j

My question is, why am I not getting "Nil" as a response as the instructions indicate should occur?


nil is not a printable response. However, we can test if a value exists...

puts creatures['tigers'].nil?    # true


Thank you. so the blank response is correct?

From the instructions in this lesson and the next, as well as other posts here, i was under the impression that the word "nil" should appear on screen. So I was just confused that and wondering why everyone else was getting "nil" as a response and I passed the lesson without it.



puts creatures['dogs'] == nil    # true

It could be that in the old track that was the response, but in the new interface it is not.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.