Eloquent Ruby, Second Edition: safe navigation explanation (page 44)

Good catch!

I accidentally pulled in the wrong code example here. The correct bit of code is:

(1 == 0)&.to_s

Since 1 == 0 is false and false is not nil, we get “false”.

Thanks!

R

1 Like