What is .nil? asking? 1/10


#1

I am on the first part of this chapter and the only thing baffling me is trying to figure out what .nil? is asking in this part of the code (line 18):
46%20AM

If translated to ‘English,’ would .nil? be asking “Is it true that this symbol cannot be found in movies?”, or is this one of many ways to phrase what .nil? would be asking?

Edit: I’d rather figure the code out before diving into the lesson as this helps me learn better.


#2

with the operator [] you reach inside movies looking for a title.
If the result is nil that means nothing was found.
That is a lot of abstraction but you don’t need t overthink it


#3

Yeah, I had a feeling I was overthinking it lol
I’ve noticed that overthinking pieces of code is very common among new people and I am no different haha
Thanks for the simple explanation to my over-magnified view of the problem.


#4

It’s totally normal and a good thing. Syntax and methods can seem…‘magical’ at first. You should be curious about these methods and what they do/how they work. A big part of your learning will come from that curiosity and finding documentation to explain it.


#5

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