If I am not wrong, you can avoid the nil?, because index-of will return nil if "Y" is not found and nil is falsy (i.e will evaluate to false).
nil?
index-of
nil
false
Loading collection data...
If I am not wrong, you can avoid the
nil?
, becauseindex-of
will return nil if "Y" is not found andnil
is falsy (i.e will evaluate tofalse
).