Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
software_writer
on Aug 21, 2023
|
parent
|
context
|
favorite
| on:
Ruby's hash is a Swiss-army knife
I don't quite understand how this code works. Where does the `nil` come from? What operation are we performing on 3 that causes it to return `nil`?
breckenedge
on Aug 21, 2023
[–]
1, 2, and 3 are being passed as lookups to the a hash. 3 is undefined on the hash, hence nil.
software_writer
on Aug 21, 2023
|
parent
[–]
Ah, that makes sense. Thank you!
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: